Migrating Billing Application Node

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

To migrate the Billing Application node to a destination server:

  • Step 1. Prepare for the migration of platform nodes.
  • Step 2. Back up the data on the source Billing Application node.
  • Step 3. Transfer the data archive to the destination Billing Application node.
  • Step 4. Configure IP addresses of the destination Billing Application node.
  • Step 5. Re-register the destination Billing Application node.
  • Step 6. Restore the data from the backup on the destination Billing Application node.
  • Step 7. Manually transfer Order Management and Payment Management keystore files.

Step 1. Prepare for the Migration

  1. Perform the general pre-migration steps for platform nodes.
  2. Deploy a clean Billing Application Node in Azure (as the destination node) as described in Billing Deployment Guide.
  3. Make sure that you know the root user password for authentication because migration scripts use SSH communication between the source and destination node.
  4. Make sure that the source and the destination Billing Application nodes are ready for migration:
    1. Log in to the source Operations Management Node as root.
    2. Download the migration archive.
    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 --app=[BACKNET_IP] --check

      where [BACKNET_IP] is the Backnet communication IP of the destination Billing Application server.

      Important: If you want to use its own IP value for the destination node, specify [BACKNET_IP]. If you decide to use the same IP address for the destination node in Azure as the IP address of the source node, 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 --app=10.207.249.54 --check

      or, for the empty IP value:

      # python ba_backup_restore.py --app= --check
    5. Make sure that the destination Billing Application node has the same timezone settings as the source Billing Application node by running the following command on the source and destination nodes:

      # ll /etc/localtime

      For example:

      /etc/localtime -> ../usr/share/zoneinfo/Europe/London

Step 2. Back Up the Data

  1. If you have custom PHP plug-ins, Office 365 customizations, or Azure CSP customizations on your CloudBlue Commerce installation, back up and transfer them to the /tmp/ directory on the destination Billing Application Node.
  2. Execute the migration script on the source Operations Management Node:

    # python ba_backup_restore.py --app=[BACKNET_IP] --backup

    where [BACKNET_IP] is the Backnet communication IP of the destination Billing Application 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 node (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 --app=10.207.249.54 --backup

    or, for the empty IP value:

    # python ba_backup_restore.py --app= --backup

Step 3. Transfer the Data Backup

Backups are transferred to the destination server automatically if the destination server 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 Application node to the same location on the destination Billing Application node.

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

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

  • Scenario 1. Preserve the IP addresses of the source Billing Application node to use them for the destination Billing Application node.
  • Scenario 2. Assign new IP addresses for the destination Billing Application node and update the corresponding IP address values in the Operations DB, Billing DB access configuration, and CloudBlue Commerce Online Store.

Scenario 1. Preserve the IP addresses of the source Billing Application node to use them with the destination Billing Application node

To do so, move the IP addresses and the host name to the destination Billing Application 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 Application node and update the corresponding IP address values in the Operations DB, Billing DB access configuration, and CloudBlue Commerce Online Store

  1. Ensure the appropriate configuration for the new IP addresses of the destination Billing Application node:
    1. Make sure that the IP addresses are assigned to the same network interfaces as on the source node.

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

    2. 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.
    3. Stop the source server and make sure that the destination server is running.
  2. Update the corresponding IP values in the Operations DB, Billing DB access configuration, and CloudBlue Commerce Online Store:
    1. Update IP addresses in the Billing DB access configuration:
      1. Update the Billing Application Node IP address in Billing DB PosgreSQL configuration file:

        # sed -i 's/<SRC_IP>/<DST_IP>/g' /var/lib/pgsql/<PostgreSQL_Version>/data/pg_hba.conf

        Where:

        • <SRC_IP> is the source IP
        • <DST_IP> is the destination IP

        For example:

        # sed -i 's/10.26.147.56/10.207.249.54/g' /var/lib/pgsql/<PostgreSQL_Version>/data/pg_hba.conf
      2. To reload PosgreSQL, execute the following command on Billing DB node:

        # systemstl reload postgresql-<PostgreSQL_Version>
      3. Reconfigure Firewall on Billing DB node:

        # sh /usr/local/bm/tools-db/pgsql_firewall.sh /var/lib/pgsql/<PostgreSQL_Version>/data
    2. 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 tableSQL query example
      aps_property_valueupdate aps_property_value set vstring= '10.207.249.54' where vstring = '10.26.147.56';
      aps_applicationupdate 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_packagesupdate aps_packages set url = replace(url, '10.26.147.56', '10.207.249.54') where url like '%10.26.147.56%';
      aps_application_instancesupdate 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_valuesupdate property_values set value='10.207.249.54' where value='10.26.147.56';
      openapi_hostsupdate openapi_hosts set ip_address='10.207.249.54' where ip_address='10.26.147.56';
      bmbridge_settingsupdate bmbridge_settings set value='10.207.249.54' where name='bm.xmlrpc.host';
      confman_parametersupdate confman_parameters set value='10.207.249.54' where name='pba.app.host.back.ip';
    3. Update IP values in CloudBlue Commerce Online Store:
      1. Change the IP values in the config files:

        # sed -i 's/<SRC_IP>/<DST_IP>/g' /etc/httpd/conf.d/*
        # sed -i 's/<SRC_IP>/<DST_IP>/g' /usr/local/bm/templatestore/conf/params.inc

        Where:

        • <SRC_IP> is the source IP
        • <DST_IP> is the destination IP

        For example:

        # sed -i 's/10.26.147.56/10.207.249.54/g' /etc/httpd/conf.d/*
        # sed -i 's/10.26.147.56/10.207.249.54/g' /usr/local/bm/templatestore/conf/params.inc
      2. Restart httpd

        #systemctl restart httpd

Step 5. Re-register the Destination Billing Application Node

  1. Log in to PCP. Go to Operations > Infrastructure > Service Nodes.
  2. Open the Billing Application node. Press Reregister and enter the root login and password.
  3. Press Reregister and wait until installation tasks are complete.

    Note:
    - You can track the installation progress at Operations > Tasks.
    - Installation tasks for the BSS-Config, Order-Management-Endpoint, and PM-Endpoint packages will fail at this point because the transferred data has not been restored yet. These tasks will be re-processed after the backups are restored.

  4. If you have custom domain registration, payment, or fraud screening plugins installed to the source system, install the RPMs of those plugins to the destination Billing Application node.
  5. Restore the custom PHP plugins, Office 365 customizations, and Azure CSP customizations (which were previously saved to the /tmp/ directory).

Step 6. Restore the Data

  1. To restore the backup on the destination Billing Application server, execute the script below on the Operations management node:

    # python ba_backup_restore.py --app=[BACKNET_IP] --restore

    Where [BACKNET_IP] is the backnet communication IP address of the destination Billing Application server.

  2. To complete the installation, rerun the failed installation tasks for the BSS-Config, Order-Management-Endpoint, and PM-Endpoint packages.

Step 7. Manually Transfer Order Management and Payment Management Keystore Files

  1. On the source Billing Application node, go to /usr/local/pem/credentials/. Copy the following files to a directory with the same path on the target Billing Application node:

    • order-management-application.ks
    • order-management-application.ts
    • pm-app.ks
    • pm-app.ts
  2. Make sure that keystore file permissions are 600 and the files are owned by the jboss user, for example:

    # ls -lah /usr/local/pem/credentials/
    total 44K
    drwxr-xr-x 2 jboss root 4.0K May 22 04:29 .
    drwxr-xr-x 14 root root 4.0K May 22 04:29 ..
    -rw------- 1 jboss root 4.4K Sep 7 2016 keystore.jks
    -rw------- 1 jboss jboss 2.2K Jan 11 2018 order-management-application.ks
    -rw------- 1 jboss jboss 935 Jan 11 2018 order-management-application.ts
    -rw------- 1 jboss root 2.6K Feb 28 03:11 pacore-keystore.jks
    -rw------- 1 jboss root 1.2K Feb 28 03:11 pacore-truststore.jks
    -rw------- 1 jboss jboss 2.2K Jan 11 2018 pm-app.ks
    -rw------- 1 jboss jboss 935 Jan 11 2018 pm-app.ts
    -rw------- 1 jboss root 903 Jun 3 2016 truststore.jks
  3. On the destination Billing Application node, restart the PAU service:

    service pau restart