Populating a Self Managed Commerce Database
Prerequisites
Ensure that you complete the following tasks before proceeding to populate the Self Managed Commerce database:
- Ensure that you have created the Self Managed Commerce database server. For more information see the Database Server Options documentation.
- Ensure that you have created the Apache ActiveMQ service. For more information see the Deploy ActiveMQ documentation.
How to Populate a Self Managed Commerce Database
Running the CloudOps for Kubernetes Jenkins job run-data-pop-tool
will run the Elastic Path Data Population tool in a Docker container. Use this Jenkins job to perform one of the following tasks:
- Create and populate a new Self Managed Commerce database
- Apply new changesets to an existing Self Managed Commerce database
- Reset or re-create, a Self Managed Commerce database
After the run-data-pop-tool
Jenkins job has completed, the Self Managed Commerce services in the same Kubernetes namespace as the database server should be restarted. This ensures that they are properly up-to-date with the new database state. Restarting the Self Managed Commerce services can be done in one of two ways:
- Set the
restartApps
parameter totrue
when running therun-data-pop-tool
Jenkins job. This will automatically restart the Self Managed Commerce services once the data population process is complete. - Run the
restart-commerce-stack
Jenkins job. For more information, see Restarting Self Managed Commerce Deployments.
Setting the stopServicesDuringDataPop
parameter to true
has the effect of restarting the Self Managed Commerce services, since they will be stopped prior to the data population process and then started once it is complete. Note that setting this option to true
will result in an application outage.
run-data-pop-tool
Jenkins Job
Parameters for the This job takes the following parameters:
containerUser
Indicates whether the data-pop-tool container image was built to run as the root user or the non-root user. It cannot be empty.
Set to non-root
if the container image was built to run as non-root (for example, it was built with release 4.2.x or newer of the Elastic Path Docker repository).
Set to root
if the container image was built to run as root (for example, it was built with release 4.1.x or earlier of the Elastic Path Docker repository).
stopServicesDuringDataPop
Set this parameter to true
in order to stop the Self Managed Commerce services prior to running the data population process. Once the data population process is complete, the Self Managed Commerce services will be started and the number of running replicas will be restored to their original state.
warning
Setting this parameter to true
will result in an application outage.
cloudOpsForKubernetesRepoURL
The URL to your hosted copy of the cloudops-for-kubernetes
Git repository.
cloudOpsForKubernetesBranch
The branch of the cloudops-for-kubernetes
Git repository that you wish to use.
kubernetesNickname
The Kubernetes namespace where the database server and related Kubernetes objects were created. Use the same value specified for kubernetesNickname
in the job you ran to create the database service. It was either the create-and-manage-database-server
or create-or-delete-mysql-container
job.
note
The Jenkins job runs the data-pop-tool
docker container inside the same namespace.
dataPopToolCommand
The data-pop-tool command to run against the database. The two valid options are reset-db
and update-db
. For more information about the two options, see the Self Managed Commerce Data Population Tool documentation.
restartApps
Set this parameter to true
in order to restart the Self Managed Commerce services after the data population process is complete.
epEnvironment
The name of the environment directory specifying the desired Elastic Path data to be populated in the database.
warning
It is important to specify the correct value for this parameter, as it controls what data get loaded to the Self Managed Commerce database. Often the Self Managed Commerce development team can clarify the correct value for this parameter.
note
The value provided must be one of the environment directories in the deployment package from which the data-pop-tool Docker image was built. For more information about environment directories, see the Self Managed Commerce Environment Directories.
imageTag
The tag of the data-pop-tool
Docker image to use. The Docker image contains the data files that define the data to populate in the Self Managed Commerce database. Selecting and specifying the correct image tag ensures that the correct data is populated in the Self Managed Commerce database.