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

How to Migrate Existing App Gateway to Another Host?

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.

  1. Server Specification:
    • Ensure that the new host meets the server specification requirements specified in this article.
  2. Docker Engine:
    • Ensure that the latest Docker Engine is installed on your new host. Details can be found in the official documentation
  3. Docker Compose:
    • Ensure that the latest Docker Compose is installed on your new host. Details can be found in the official documentation.
  4. 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.
  5. 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.
  6. 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
      • /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.
  7. 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>
  8. 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.
  9. 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
  10. 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.
  11. Decommission Old Host:
    • Finally, you can completely decommission the old host.