BEFORE YOU BEGIN, CAREFULLY READ THIS ENTIRE DOCUMENT!

Server migration overview:

  1. Install CAS on a new server (use the same license key).

  2. Shutdown the old CAS and create a backup of the data.

  3. Copy the backup from the old server to the new server.

  4. Restore the CAS backup data on the new server.

  5. Switch your BATM's to access the new server (SERVER IP).

Try to plan the migration around GB's active support hours (in event of a problem).

Consider & prepare for the imminent impact, for instance:

You have several options:


Step 1 - Install CAS on a new server

The CAS versions must be identical on both the old & new server!


Step 2 - Backup the old (“source”) server’s CAS:

Stop ALL CAS services:

sudo /batm/batm-manage stop all

Backup your CAS data:

sudo /batm/batm-manage backup

Step 3 - Copy the backup to the new server:

Copy the backup/source directory (noted in the previous step) over to the new/target machine.

The following example demonstrates using the SCP method:

  1. Your old CAS IP address is “1.2.3.4”

  2. The backup directory is: "/batm/backup/20180923-151804-0400",

  3. You have sudo (root/superuser) access.

cd /batm/backup
sudo scp -r root@1.2.3.4:/batm/backup/20180923-151804-0400 .

Step 4 - Restore the backup on the new server:

The restore procedure is normally used on the same system - not on a new system as it is in this case. The restore should be modified to provide the wanted data (only). Some data isn’t required -or- will only create extra work (bad data).

Some configuration will be lost with a selective restore (as is demonstrated below). Missing configurations should be setup again using the appropriate feature’s instructions.

Migration restore using the batm-manage utility:

sudo /batm/batm-manage restore /batm/backup/20180923-151804-0400 "config data db"

Lastly, modify the /batm/config/network file to point to the current IP.

Access denied for user 'root'@'localhost' ?

See Troubleshooting at the bottom of the article.


Step 5 - Point the BATMs to the new CAS

The BATMs in your network now need to be redirected to the new server.

If your hosting service has the capability of reassigning your old/known IP to the new CAS server, then you should do so now. This is an unusual scenario - but some hosting services offer it. In some cases you may have a discreet backup & simply restore to a new Ubuntu image on your server. In these events - where the IP of your server hasn’t changed - you are done - you don’t need to change anything further (skip this step).

IN MOST CASES: you will follow one of these 2 procedures to change the BATMs' settings. Each BATM must be individually changed. There is no “batch” method (no matter which approach you take), though it is possible to create the redirection flags via a script (outside the scope of this article). Rebooting each BATM must be done one at a time, either onsite or via CAS. This is deliberate & prudent.

Option A:

note

The directory structure changed in CAS version 20230515. If you are using an older version, replace all references (below) of “/batm/app/shared" to “/batm/app/master" !

  • The instructions provided below are for CAS version 20230515 and later.

The directory structure changed in CAS version 20230515. If you are using an older version, replace all references (below) of “/batm/app/shared" to “/batm/app/master" !

  • The instructions provided below are for CAS version 20230515 and later.

Create a redirection flag.

This option requires that the same license key is used on both CAS hosts!

Example:

  • NEW server IP address: “10.20.30.40”

  • Default master port: “7741”

  • BATM serial number: BT123456

Using that example information, type this command at your OLD server’s command prompt:

sudo bash -c 'echo -n "https://10.20.30.40:7741/apiv1" > /batm/app/shared/server.BT123456'

Then, tell the BATM to check for the new information the next time it calls home:

sudo touch /batm/app/shared/reconfigure.BT123456

Finally, reboot your BATM.

The BATMs will then connect to the old server, see the new configuration request, and will change their Server IP to point to the new server.

  • In a typical scenario, you won’t have to travel to the BATM.

  • Check the new server (administration console, logs, etc.) to verify there are no errors and BT123456 is now connecting as desired.

Beware that each transaction directed to your old server from now on won't be logged in the database of the new server. To check for errors, you should therefore use a BATM that is currently on and has good network connection.

  • Alternatively, you can deactivate all the other BATMs in your administration console and reactivate them once the first BATM gets redirected without errors.

Option B:

Travel to each BATM physically & change the Server IP onsite as described here:

Set the BATM Server IP


Step 6 - Reboot the BATM(s).

You can do this remotely or onsite.


Troubleshooting

Access denied for user 'root'@'localhost':

If you encounter this error during the restore, then your MySQL root password is insecure. You’ll need to set a password for the MySQL root account to restore the database.

  1. INSTRUCTIONS: https://generalbytes.atlassian.net/wiki/spaces/ESD/pages/2555052033/Database+Configuration+Notes#Root-passwords

  2. Reattempt the restore from the beginning.

Admin service shuts down:

If you restored everything during Step 4 (Restore), then you’ve overwritten your configuration files. Your network configuration file is amongst them. Bad entries in the network config file will cause this (and other symptoms).

First, determine your CAS server IP: What is the IP address of my CAS server?

Ensure your new/target IP is properly set in your network config file:

The “public_ip” setting is normally the public IP of your CAS server (example used: 1.2.3.4):

su -c 'sed s/^public_ip=.*/public_ip=1.2.3.4/ /batm/config/network'

My notifications point to the wrong domain:

Correct the hostname:

su -c 'hostname > /batm/config/hostname'

If you know your domain name, and wish to enter it specifically (recommended), use:

su -c 'echo your.host.name > /batm/config/hostname'

Start the new CAS and note any reported errors.

Missing configurations:

Some configurations may be lost when migrating. Some migrations won’t be affected at all, and others will have to reconfigure a number of features. This article is designed to guide the many, so the few that are missing features will have to walk through the setup of each configuration individually.

Examples of some lost configurations might include:

Review and copy the relevant configuration files from the old server to quickly restore these settings.


Related articles

The content by label feature displays related articles automatically, based on labels you choose. To edit options for this feature, select the placeholder below and tap the pencil icon.

Related issues