Author: Chris Breaux
Date: November 13, 2023
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 utilise a Replicated Snapshot to do just that. This would be appropriate when keeping the existing database sever is desired. This is one of several methods to accomplish this task.
- In the existing KOTS installation, configure the 'Snapshot settings' to point to a 'Host Path' instead of Internal Storage. The 'Host Path' you configure should be a directory you've created to house these snapshots.
You may need to open permissions for this directory so that it's accessible by Velero.
(There are other options here, cloud hosts, that would also likely work but would require additional configuration and have not yet been tested)
- With the Snapshot location now pointing to your application server, initiate a 'Full Snapshot'
- When the snapshot is complete, transfer the backup directory to the new server.
- In your new server, go ahead and install KOTS
- 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)
- 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 make take a minute to appear after configuring the velero hostpath)
- 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)
- 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)
- This will replace all of the Replicated admin console settings with your backup's, including the admin console password.
If needed, the command to reset this password is:
kubectl kots reset-password -n default
- Watch the pods come up and troubleshoot as required
This was tested on our support servers with self-signed certs. We needed to change the application host name in the settings to reflect the change in application server locations.