Replicating configurations and data from a source environment to a target environment
The following scenarios describe the use case for replicating environment configurations and data:
Use the database refresh pipeline to replicate the following Foundation data, application data, and application configurations from a source environment to a target environment:
- BMC Helix Innovation Suite configurations
- BMC Helix ITSM: Smart Reporting configurations
- BMC Helix Single Sign-On OAuth configurations
- BMC Digital Workplace Catalog connectors configurations
- BMC Digital Workplace configurations
- Cognitive and BMC Helix Chatbot configurations
- BMC Helix ITSM users
- Web services filters
The following image shows the replication process:
Before you begin
- Make sure that the source and target environments are using the same BMC Helix Service Management version.
Make sure that the PostgreSQL client such as psql version on your BMC Deployment Engine where you plan to run the pipeline and the PostgreSQL client version on your target database are the same.
- Make sure that your BMC Helix Service Management target environment is licensed and that the number of licenses on the target environment and source environment are the same.
- Make sure that you copy the source and target configuration repositories.
To copy the source and target configuration repositories
- In the source environment, copy the CUSTOMER_CONFIGS repository located in the directory that contains all the Git repositories in BMC Deployment Engine. Rename it to SOURCE_CUSTOMER_CONFIGS.
- In the target environment, copy the CUSTOMER_CONFIGS repository located in the directory that contains all the Git repositories in BMC Deployment Engine. Rename it to TARGET_CUSTOMER_CONFIGS.
- Copy the SOURCE_CUSTOMER_CONFIGS and TARGET_CUSTOMER_CONFIGS repositories to the environment where you want to run the database refresh pipeline.
For example, to run the database refresh pipeline in the target environment, make sure that the following repositories are present in the git repository of the target environment:- SOURCE_CUSTOMER_CONFIGS
- TARGET_CUSTOMER_CONFIGS
- DB_REFRESH_REPO
Database refresh pipeline modes and parameters
Use the database refresh pipeline, HELIX_DB_REFRESH, to replicate configurations from one environment to another.
The database refresh pipeline, HELIX_DB_REFRESH, provides the following modes:
- BACKUP_CONFIGURATION—In this mode, the HELIX_DB_REFRESH pipeline backs up the configurations of the target environment.
- RESTORE_CONFIGURATION—In this mode, the HELIX_DB_REFRESH pipeline restores configurations from one environment to another.
The database refresh pipeline, HELIX_DB_REFRESH, contains the following input parameters:
Parameter | Description |
---|---|
RERUN | Select this check box to rerun the pipeline from where it failed in the last run. |
BACKUP_CONFIGURATION | Select this check box to back up configurations in the target environment. |
RESTORE_CONFIGURATION | Select this check box to restore source database backup configurations to the target environment. |
LOCATION | Specify the temporary working directory location of the pipeline. Example: /home/git/workspace |
REPO_PATH | Specify the repository path name where the SOURCE_CUSOTMER_CONFIGS, TARGET_CUSTOMER_CONFIGS, and DB_REFRESH_REPO repositories are located. Example: ssh://<Jenkins server host name>/home/git/git_repo |
SOURCE_CUSTOMER_NAME | Specify the CUSTOMER_NAME parameter value that you provided in the HELIX_ONPREM_DEPLOYMENT Jenkins pipeline during the installation of BMC Helix Service Management on the source environment. |
SOURCE_CUSTOMER_SERVICE | Specify the CUSTOMER_SERVICE parameter value that you provided in the HELIX_ONPREM_DEPLOYMENT Jenkins pipeline during the installation of BMC Helix Service Management on the source environment. |
SOURCE_ENVIRONMENT | Specify the ENVIRONMENT parameter value that you provided in the HELIX_ONPREM_DEPLOYMENT Jenkins pipeline during the installation of BMC Helix Service Managementthe source environment. The HELIX_DB_REFRESH pipeline uses the SOURCE_CUSTOMER_NAME, SOURCE_CUSTOMER_SERVICE, and SOURCE_ENVIRONMENT parameters to identify the Deployment Input Configuration file location in the source environment. |
TARGET_CUSTOMER_NAME | Specify the CUSTOMER_NAME parameter value that you provided in the HELIX_ONPREM_DEPLOYMENT Jenkins pipeline during the installation of BMC Helix Service Management on the target environment. |
TARGET_CUSTOMER_SERVICE | Specify the CUSTOMER_SERVICE parameter value that you provided in the HELIX_ONPREM_DEPLOYMENT Jenkins pipeline during the installation of BMC Helix Service Management on the target environment. |
TARGET_ENVIRONMENT | Specify the ENVIRONMENT parameter value that you provided in the HELIX_ONPREM_DEPLOYMENT Jenkins pipeline during the installation of BMC Helix Service Management on the target environment. The HELIX_DB_REFRESH pipeline uses the TARGET_CUSTOMER_NAME, TARGET_CUSTOMER_SERVICE, and TARGET_ENVIRONMENT parameters to identify Deployment Input Configuration file location in the target environment. |
TARGET_EXT_IP | Specify the PLATFORM_ADMIN_PLATFORM_EXTERNAL_IPS parameter value that you provided in the HELIX_ONPREM_DEPLOYMENT pipeline during the installation of BMC Helix Service Management on the target environment. |
IS_DB | Select this check box to back up and restore BMC Helix Service Management configurations. |
SMART_REPORTING | Select this check box to back up and restore BMC Helix ITSM: Smart Reporting configurations. |
Task 1: To back up the source and target environment
Take a complete backup of your source and target databases.
Use your preferred method to back up the databases.
Task 2: To back up configurations of the target environment
- Log in to the Jenkins server by using the following URL:
http://<Jenkins server host name>:8080 - On the Jenkins server, select the HELIX_DB_REFRESH pipeline.
- Select the BACKUP_CONFIGURATION check box and clear the RESTORE_CONFIGURATION check box.
- Specify the values for the LOCATION and REPO_PATH parameters.
- Specify the values for the SOURCE_CUSTOMER_NAME, SOURCE_CUSTOMER_SERVICE, and SOURCE_ENVIRONMENT parameters.
- Specify the values for the TARGET_CUSTOMER_NAME, TARGET_CUSTOMER_SERVICE, and TARGET_ENVIRONMENT parameters.
- Specify the value for the TARGET_EXT_IP parameter.
- Select the IS_DB check box to back up BMC Helix Service Management configurations.
- Select the SMART_REPORTING check box to back up BMC Helix ITSM: Smart Reporting configurations.
- Click Rebuild.
The HELIX_DB_REFRESH pipeline runs in the BACKUP_CONFIGURATION mode. It creates a backup of the configurations and scales down all the application pods.
The pipeline creates the backup files and folders at the custom workspace location
Task 3: To restore the source database backup to the target environment
After the database refresh pipeline is completed successfully in the BACKUP_CONFIGURATION mode, restore the source database backup to the target database.
Use your preferred method to restore the database backup.
After you restore the backup, the target database contains the source environment configurations and source environment data.
Task 4: To restore configurations to the target environment
- Log in to the Jenkins server on the environment where you want to run the pipeline by using the following URL:
http://<Jenkins server host name>:8080 - On the Jenkins server, select the HELIX_DB_REFRESH pipeline.
- In the Build History, select the latest build and click Rebuild.
- Clear the BACKUP_CONFIGURATION check box.
Select the RESTORE_CONFIGURATION check box.
- Click Rebuild.
The pipeline runs in the RESTORE_CONFIGURATION mode. It restores the configurations and scales up all the application pods.
After you restore the configurations, the target database contains the target environment configurations and source environment data.
To rerun the HELIX_DB_REFRESH pipeline
If you encounter a failure in BACKUP_CONFIGURATION or RESTORE_CONFIGURATION mode while you are running the HELIX_DB_REFRESH pipeline, use the RERUN option to rerun the pipeline.
- On the Jenkins UI, navigate to the HELIX_DB_REFRESH pipeline where the failure occurred.
- In the Build History pane of the pipeline where the failure occurred, select the latest build, and click Console Output.
- On the Console Output page, go through the logs to identify the reason for the failure.
- Debug and fix the issue.
- Rerun the HELIX_DB_REFRESH pipeline.
- Navigate to the pipeline where the failure occurred.
- In the Build History pane of the failed pipeline, select the latest build, and click Rebuild.
- On the Rebuild page, select the RERUN check box , and click Rebuild.
The pipeline starts running from the stage where it stopped due to the failure.