Migrating CloudBlue Commerce Online Store
This procedure is a part of the platform nodes migration from an on-premise environment to Azure cloud.
To migrate the CloudBlue Commerce Online Store node to a destination server:
- Step 1. Prepare for the migration.
- Step 2. Back up the data on the source Online Store node.
- Step 3. Transfer the data archive to the destination Online Store node.
- Step 4. Configure IP addresses of the destination Online Store node.
- Step 5. Re-register the destination Online Store node.
- Step 6. Restore the data from the backup on the destination Online Store node.
Step 1. Prepare for the Migration
- Perform the general pre-migration steps for platform nodes.
- Deploy a clean CloudBlue Commerce Online Store node in Azure (as the destination node) as described in Billing Deployment Guide.
-
Ensure access from the source Online Store node to the destination Online Store node in one of the two ways:
Note: Migration scripts use SSH communication between the source and destination nodes.
-
Ensure access by password: Obtain a password for the root user to access the destination Online Store node through SSH.
Note: As an alternative, you can also create a sudo-enabled user.
- Configure password-less access.
-
- Make sure that the source and destination Online Store servers are ready for the migration:
- Log in to the Operations management node as root through SSH.
- Download the migration script.
Extract the content of the archive with this command:
# unzip ba-backup-restore-1.0.1-script.zip
# cd ba_backup_restoreRun the pre-check script:
# python ba_backup_restore.py --db=[BACKNET_IP] --check
where [BACKNET_IP] is the Backnet communication IP address of the destination Online Store server.
Important: If you decide to use the IP address of the source node for the destination node in Azure, leave the [BACKNET_IP] empty. Please note, however, that in such a case you will not be able to establish communication between the source and the destination node during the migration process (because they will have the same IP address) and, therefore, will not be able to use such communication for the migration purposes.
For example:
# python ba_backup_restore.py --store=10.207.249.54 --check
or, for the empty [BACKNET_IP] value:
# python ba_backup_restore.py --store= --check
Step 2. Back Up the Data
To back up the data on the source server, execute the migration script on the Operations management node:
# python ba_backup_restore.py --store=[BACKNET_IP] --backup
where [BACKNET_IP] is the Backnet communication IP of the destination Online Store server.
Note: If you want to use its own IP value for the destination node, specify [BACKNET_IP]. In such a case, the subsequent data transfer to the destination server (see below) is performed by the ba_backup_restore.py script automatically. However, if you choose to retain the IP address of the source node to assign it to the destination node, leave [BACKNET_IP] empty. In such a case, as it was noted above, you will not be able to establish communication between the source and the destination node and, therefore, will have to transfer the backed-up data to the destination node manually.
For example:
# python ba_backup_restore.py --store=10.207.249.54 --backup
or, for the empty [BACKNET_IP] value:
# python ba_backup_restore.py --store= --backup
Step 3. Transfer the Data Backup
Backups are transferred to the destination server automatically if the destination IP address is specified during the backup procedure above. Otherwise, transfer the backups to the destination server manually: copy the /var/backup directory from the source Online Store node to the same location on the destination Online Store node.
Step 4. Configure IP Addresses of the Destination Online Store Node
Depending on whether or not you want to preserve the IP addresses of the source Online Store node to use them for the destination Online Store node, you can follow one of the two scenarios:
- Scenario 1: Preserve the IP addresses of the source node to use them for the destination node.
- Scenario 2: Assign new IP addresses for the destination node and update the corresponding IP values in Operations DB and Billing DB.
Scenario 1. Preserve the IP addresses of the source Online Store node to use them for the destination Online Store node
To do so, move the IP addresses and the host name to the destination Online Store node:
-
Assign the source host IP addresses to the destination host.
Note: Even though it is possible to assign a new IP address to the destination host, make sure that all steps from "Changing the Backnet IP address (optional step)" are performed.
-
Make sure that, on the destination host, IP addresses are assigned to the same network interfaces as they were configured on the source host. Remove temporary IP addresses.
Note: If it is impossible to use the network interface names from the source node on the destination node, apply the workaround from KB132165.
- Configure the host name on the destination node so that it matches the name of the source node. Then make sure that the hostname resolution is the same as on the source node. If a virtualization technology is used, make sure that it has the correct settings (IP addresses, hostname, and name servers) for the destination node.
- Stop the source server and make sure that the destination server is running.
Scenario 2. Assign new IP addresses for the destination Online Store node and update the corresponding IP values in Operations DB and Billing DB
-
Update IP values in Operations DB:
To do so, run all the following SQL queries in Operations DB for each source-destination IP pair:
Note: In the examples of SQL queries below, 10.26.147.56 is the source IP address and 10.207.249.54 is the destination IP address.
Operations DB table SQL query example aps_property_value update aps_property_value set vstring= '10.207.249.54' where vstring = '10.26.147.56';
aps_application update aps_application set endpoint_uri=replace(endpoint_uri, '10.26.147.56', '10.207.249.54') where endpoint_uri like '%10.26.147.56%';
aps_packages update aps_packages set url = replace(url, '10.26.147.56', '10.207.249.54') where url like '%10.26.147.56%';
aps_application_instances update aps_application_instances set uri = replace(uri, '10.26.147.56', '10.207.249.54') where uri like '%10.26.147.56%';
configured_ips update configured_ips set ip_address='010.207.249.054' where ip_address='010.026.147.056';
Note: For this DB table, make sure that both IP addresses in each IP pair are 0-padded (add '0' where necessary): 010.026.147.056
property_values update property_values set value='10.207.249.54' where value='10.26.147.56';
confman_parameters update confman_parameters set value='10.207.249.54' where name='pba.app.host.back.ip';
-
Update IP values in Billing DB:
To do so, run all the following SQL query in Billing DB for each source-destination IP pair:
Note: In the SQL query example below, 10.26.147.56 is the source IP address and 10.207.249.54 is the destination IP address.
Billing DB table SQL query example StoreSyncConf update "StoreSyncConf" set "AssignedURI"= replace("AssignedURI", '10.26.147.56', '10.207.249.54') where "AssignedURI" like '%10.26.147.56%'
Step 5. Re-register the Destination Online Store Node
- Go to Provider Control Panel > Operations > Infrastructure > Service Nodes. Open the Online Store node.
- Press Reregister and enter the root login and password.
-
Press Reregister and wait until all installation tasks are completed.
Note: You can track the installation progress at Operations > Operations > Tasks.
Step 6. Restore the Data
To restore the backup on the destination server, execute the script below on the Operations management node:
# python ba_backup_restore.py --store=[BACKNET_IP] --restore
where [BACKNET_IP] is the new backnet communication IP address of the destination Online Store server.
For example:
# python ba_backup_restore.py --store=10.207.249.54 --restore