There comes a time when you need to migrate an existing App Gateway to another host or system due to certain circumstances. This article will guide you on how to migrate the App Gateway system.
- Server Specification:
- Ensure that the new host meets the server specification requirements specified in this article.
- Docker Engine:
- Ensure that the latest Docker Engine is installed on your new host. Details can be found in the official documentation
- Docker Compose:
- Ensure that the latest Docker Compose is installed on your new host. Details can be found in the official documentation.
- Time Synchronization:
- Ensure your new host is configured with an international standard NTP to synchronize the clock. This can be achieved using several methods and packages, and each customer may have their own preferred way.
- Stop App Gateway:
- Ensure that the App Gateway system on the old host has been stopped:
docker-compose -f /etc/cyolo/config/docker-compose.yml down
docker-compose -f /etc/safous/user-portal/docker-compose.yml down - Check that no container of the App Gateway system is still running:
docker ps -a
- Verify web access to the user portal by opening your tenant URL, e.g., `https://login.<tenant>.ztna.safous.com`. If the user portal cannot be reached, then the previous commands were executed correctly.
- Ensure that the App Gateway system on the old host has been stopped:
- Backup Important Directories and Items:
- On the old host with the App Gateway system, back up the following directories and items:
- /etc/cyolo:
tar -zcvf <BACKUP_FILE_NAME>.tar.gz -C /etc cyolo
- /etc/safous:
tar -zcvf <BACKUP_FILE_NAME>.tar.gz -C /etc safous
- /etc/cyolo:
-
- /blobs:
tar -zcvf <BACKUP_FILE_NAME>.tar.gz /blobs
- crontab:
sudo crontab -l -u root
Copy the output and paste it into a notepad on your local PC.
- /blobs:
- On the old host with the App Gateway system, back up the following directories and items:
- Transfer Backup Files:
- Copy all tar backup files from the old host to the new host using the following command:
scp <BACKUP_FILE_NAME>.tar.gz <USERNAME>@<NEW_HOST_IP>:<DEST_PATH>
- Copy all tar backup files from the old host to the new host using the following command:
- Restore Backup Files:
- Once all backup files have been copied to the new host, uncompress all backup files and place them in the intended directory path, the same as the old host. For crontab, copy the content from the local PC and paste it into the new host's crontab:
- /etc/cyolo**:
tar -zxvf <BACKUP_FILE_NAME>.tar.gz -C /etc/
- /etc/safous:
tar -zxvf <BACKUP_FILE_NAME>.tar.gz -C /etc/
- /blobs:
tar -zxvf <BACKUP_FILE_NAME>.tar.gz -C /
- crontab:
sudo crontab -e -u root
Paste the previous crontab content.
- /etc/cyolo**:
- Once all backup files have been copied to the new host, uncompress all backup files and place them in the intended directory path, the same as the old host. For crontab, copy the content from the local PC and paste it into the new host's crontab:
- Start App Gateway System on the New Host:
- Run the following commands to start the App Gateway system on the new host; also check that App Gateway container is running properly:
docker-compose -f /etc/cyolo/config/docker-compose.yml up -d
docker-compose -f /etc/safous/user-portal/docker-compose.yml up -d
docker ps -a
- Run the following commands to start the App Gateway system on the new host; also check that App Gateway container is running properly:
- Verify Web Access:
- Wait for 5-10 minutes, then check the web access to the user portal by opening your tenant URL, e.g., `https://login.<tenant>.ztna.safous.com`. You should be able to access the user portal and log in normally.
- Decommission Old Host:
- Finally, you can completely decommission the old host.
- Finally, you can completely decommission the old host.