Skip to main content
Skip table of contents

DCT data backup, recovery, and migration

This method is only applicable for Kubernetes and OpenShift.

  • For Kubernetes, use the kubectl command prefix.

  • For OpenShift, use the oc command prefix. 

The following directions will guide you through a Data Control Tower (DCT) back, recovery, and migration. They can be used for a “lift and shift” or a “blue-green” deployment. However, the backup and recovery steps are standardized and can be applied in one-off scenarios as well.

This page refers to the two DCT servers as Initial and Destination

Example deployment scenarios

An example of a “lift and shift” deployment could be:

  1. Backup the running Initial server pre-upgrade.

  2. Upgrade the Initial server to the desired version and confirm functionality.

  3. Backup the Initial server post-upgrade.

  4. Install a new Destination server as the same Initial server’s post-upgrade version.

  5. Restore the Initial post-upgrade backup to the Destination server.

  6. Restart the Destination services and confirm functionality.

  7. Shutdown the Initial server or maintain it for further testing.

An example of a “blue-green” deployment could be:

  1. Backup the running Initial server.

  2. Install a new Destination server with the same Initial server’s version.

  3. Restore the Initial backup to the Destination server.

  4. Restart the Destination services and confirm functionality.

  5. Upgrade the Destination server to the newer version and confirm functionality.

  6. Redirect traffic to the Destination server.

  7. Shutdown the Initial server or maintain it for a future blue-green deployment.

Prerequisites

  1. The Initial (source) DCT server is up and running.

    1. Referred to as svr_source in any CLI commands.

  2. The Destination (target) DCT server is installed in a separate Kubernetes cluster. 

    1. It is the same version as the Initial DCT server when the backup is taken.

    2. Referred to as svr_target in any CLI commands.

  3. We can share backup files from Initial to Destination environments.

  4. Sufficient access to perform various kubectl commands on both the Initial and Destination clusters.

Directions

1. Backup

First, ensure the Initial DCT server is running, to take a successful backup. Then, run the following two commands:

CODE
kubectl cp <srv_source-gateway-pod>:/data data --namespace <srv_source-namespace>
CODE
kubectl exec -it <srv_source-database-pod> --namespace <srv_source-namespace> -- pg_dumpall -U postgres > postgres_db_all.sql

This will create two files: data and postgres_db_all.sql:

  • data is the Gateway pod’s persistent volume containing various configuration information.

  • postgres_db_all.sql is a complete database backup.

2. Restore

Ensure the Destination DCT server is running to restore successfully. In addition, make the  postgres_db_all.sql and data files available to the Destination cluster in the subsequent steps.

Then, run the following four commands:

CODE
kubectl cp data <srv_target-namespace>/<srv_target-gateway-pod>:/data
CODE
kubectl cp postgres_db_all.sql <srv_target-namespace>/<srv_target-database-pod>:/tmp
CODE
for i in app bookmarks data-library jobs
{
   kubectl exec -it <srv_target-database-pod> --namespace <srv_target-namespace> -- dropdb $i
}
CODE
kubectl exec -it <srv_target-database-pod> --namespace <srv_target-namespace> -- psql -U postgres -f /tmp/postgres_db_all.sql

Finally, delete and restart the DCT pods:

CODE
for i in `kubectl get pods --namespace <srv_target-namespace> | awk '{print $1}' | grep -v jobs-cleaner | egrep "gateway|data-library|jobs|data-bookmarks"`
{
   kubectl delete pod $i -n <srv_target-namespace>
}

After deleting the pods, Kubernetes will automatically recreate them and absorb the new database backup, and gateway volume data.

3. Additional environment configuration

The HELM chart’s values.yaml contains information specific to your environment, such as certificates, hostname, or resource limits. You can update this information before or after the migration process. The standard installation and configuration process can be followed to update these values.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.