Migrating Billing Database Node

This procedure is a part of the platform nodes migration from an on-premise environment to Azure cloud.

To migrate the Billing DB node to a destination server:

  • Step 1. Prepare for the migration.
  • Step 2. Back up the data on the source Billing DB node.
  • Step 3. Transfer the data archive to the destination Billing DB node.
  • Step 4. Configure IP addresses of the destination Billing DB node.
  • Step 5. Re-register the destination Billing DB node.
  • Step 6. Restore the data from the backup on the destination Billing DB node.

Step 1. Prepare for the Migration

  1. Perform the general pre-migration steps for platform nodes.
  2. Deploy a clean Billing DB node in Azure (as the destination node) as described in Billing Deployment Guide.
  3. Ensure access from the source Billing DB node to the destination Billing DB 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 Billing DB node through SSH.

      Note: As an alternative, you can also create a sudo-enabled user.

    • Configure password-less access.
  4. On Operations DB node, adjust the timezone settings:

    Go to /var/lib/pgsql/<PostgreSQL_Version>/data/postgresql.conf. If the timezone and log_timezone fields have the Host value, change it to the required timezone.

  5. Make sure that the source and destination Billing DB servers are ready for the migration:
    1. Log in to the Operations management node as root.
    2. Download the database migration script.
    3. Extract the content of the archive with this command:

      # unzip ba-backup-restore-1.0.1-script.zip
      # cd ba_backup_restore
    4. Run 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 Billing DB 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 --db=10.207.101.115 --check

      or, for the empty [BACKNET_IP] value:

      # python ba_backup_restore.py --db= --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 --db=[BACKNET_IP] --backup

where [BACKNET_IP] is the Backnet communication IP of the destination Billing DB 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 --db=10.207.101.115 --backup

or, for the empty [BACKNET_IP] value:

# python ba_backup_restore.py --db= --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 Billing DB node to the same location on the destination Billing DB node.

Step 4. Configure IP Addresses of the Destination Billing DB Node

Depending on whether or not you want to preserve the IP addresses of the source Billing DB node to use them with the destination Billing DB node, you can follow one of the two scenarios:

  • Scenario 1: Preserve the IP addresses of the source Billing DB node to use them for the destination Billing DB node.
  • Scenario 2: Assign new IP addresses for the destination Billing DB node and update the corresponding IP values in Operations MN, Operations DB, Billing DB access configuration.

Scenario 1. Preserve the IP addresses of the source Billing DB node to use them for the destination Billing DB node

To do so, move the IP addresses and the host name to the destination Billing DB node:

  1. Assign the IP addresses of the source node to the destination node.
  2. Make sure that the IP addresses are assigned to the same network interfaces as they were configured on the source node. Remove all temporary IP addresses, if any.

    Note: If it is impossible to use the network interface names from the source node on the destination node, apply the workaround from KB132165.

  3. 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, name servers) for the destination node.
  4. Stop the source server and make sure that the destination server is running.

Scenario 2. Assign new IP addresses for the destination Billing DB node and update the corresponding IP values in Operations MN, Operations DB, Billing DB access configuration

Please refer to How to Change Billing DB IP.

Step 5. Re-register Billing DB Node

  1. Go to Provider Control Panel > Operations > Infrastructure > Service Nodes. Open Billing DB node.
  2. Press Reregister and enter authorization data.
  3. Press Reregister and wait until all installation tasks are completed.

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 --db=[BACKNET_IP] --restore

where [BACKNET_IP] is the new backnet communication IP address of the destination Billing DB server.

For example:

# python ba_backup_restore.py --db=10.207.101.115 --restore