KOTS to KOTS: Migrate Application Servers Using A Replicated Snapshot

Chris
Chris
  • Updated

Author: Chris Breaux

Updated: June 2024

Audience: Everyone

Environmental details: KOTS

We have existing documentation that covers migrating from Traditional to KOTS. What is the procedure for migrating application servers when one is already in a KOTS environment? This article outlines the steps to utilize a Replicated Snapshot to do just that. This would be appropriate when keeping the existing database server is desired. This is one of several methods to accomplish this task.

Solution:

  1. In the existing KOTS installation, you can configure the 'Snapshot settings' to point to a 'Host Path' instead of Internal Storage. The 'Host Path' you configure should be the directory you created to house these snapshots.
    You may need to open permissions for this directory so that Velero can access it.
    (There are other options here, cloud hosts, that would also likely work but would require additional configuration and have not yet been tested)
    kots_snapshot_01.pngkots_snapshot_02.png
  2. With the Snapshot location pointing to your application server, initiate a 'Full Snapshot.'
    kots_snapshot_03.png
  3. When the snapshot is complete, transfer the backup directory to the new server.
  4. In your new server, go ahead and install KOTS
  5. After you've installed your license but before you have created a deployment run the following command in the terminal:
    kubectl kots velero configure-hostpath --namespace default --hostpath /home/support/tmp/mybackups
    (The hostpath argument should match the location of the snapshot you moved over in step 3)
  6. Once you have progressed through the prompts and this has completed, you can check the status with: kubectl kots get backups
    You should see an output with something like:
    NAME STATUS ERRORS WARNINGS STARTED COMPLETED EXPIRES
    instance-wwxw7 Completed 0 0 2023-11-10 22:54:55 +0000 UTC 2023-11-10 22:55:21 +0000 UTC 29d
    (It may take a minute to appear after configuring the velero hostpath)
  7. We want to avoid pointing two active instances at the same database, so, we would need to shut down the original server (if that hasn't been done already)
  8. Once you can see the backup in place, you can run the following command:
    kubectl kots restore --from-backup BACKUP
    (replace BACKUP with the name of the backup, instance-wwxw7 in the example above)
  9. This will replace all the Replicated admin console settings with your backups, including the admin console password.
    If needed, the command to reset this password is:
    kubectl kots reset-password -n default
  10. Watch the pods come up and troubleshoot as required

Notes:

This was tested on our support servers with self-signed certs. We needed to change the application hostname in the settings to reflect the change in application server locations.

 

 

Related to

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.