1. Support Center
  2. F.A.Q
  3. Application Gateway Question

How to Migrate Existing App Gateway to Another Host?

There's a time where you need to migrated existing App Gateway to another host or system because of some circumstances.
This article will guide you on how to migrate the App Gateway system.

 

  1. As App Gateway only can run in Linux, please ensure your new host is using Linux Operating System (recommended to use Ubuntu 20.04)
  2. Ensure in your new host you already installed the latest Docker Engine for server
  3. Ensure in your new host you already installed the latest Docker Compose
  4. Ensure your new host has been configured with international standard NTP to synchronize the clock. This can be achievable using several methods and packages, which each customer has their own preferred way.
  5. Ensure your App Gateway system in old host has been stopped
    • Stopping the App Gateway system
      docker-compose -f /etc/cyolo/config/docker-compose.yml down
      docker-compose -f /etc/safous/user-portal/docker-compose.yml down
    • Check no container of App Gateway system still running
      docker ps -a
  6. Check the web access to user portal by opening your tenant, e.g https://login.<tenant>.ztna.safous.com . If the user portal cannot be reach, then it means previous command is correctly done
  7. On old host that has App Gateway system, you need to back up these directory and items
    • /etc/cyolo -- Please run this command
      tar -zcvf <BACKUP_FILE_NAME>.tar.gz -C /etc cyolo
    • /etc/safous -- Please run this command
      tar -zcvf <BACKUP_FILE_NAME>.tar.gz -C /etc safous
    • /blobs -- Please run this command
      tar -zcvf <BACKUP_FILE_NAME>.tar.gz /blobs
    • crontab -- Please run this command then copy the output and paste it to notepad on local PC. 
       sudo crontab -l -u root
  8. Copy all tar backup files from old host to new host by using these commands
    scp <BACKUP_FILE_NAME>.tar.gz <USERNAME>@<NEW_HOST_IP>:<DEST_PATH>
  9. Once all backup files has been copied from old host to new one, then you need to uncompressed all backup files and put it in intended directory path same as the old host. For crontab, copy content from local PC and paste it on new host crontab.
    • /etc/cyolo -- Please run this command
      tar -zxvf <BACKUP_FILE_NAME>.tar.gz -C /etc/
    • /etc/safous -- Please run this command
      tar -zxvf <BACKUP_FILE_NAME>.tar.gz -C /etc/
    • /blobs -- Please run this command
      tar -zxvf <BACKUP_FILE_NAME>.tar.gz -C /
    • crontab -- Please run this command and paste the previous crontab content
      sudo crontab -e -u root
  10. Run these commands to run App Gateway system in the new host
    docker-compose -f /etc/cyolo/config/docker-compose.yml up -d
    docker-compose -f /etc/safous/user-portal/docker-compose.yml up -d
  11. Check the App Gateway container has run properly
    docker ps -a
  12. Wait for 5-10 minutes, then check the web access to user portal by opening your tenant, e.g https://login.<tenant>.ztna.safous.com . You should be able to access again the user portal and login normally
  13. Lastly, now you can entirely decommission the old host