Restore from backup

In the event that a majority of the RethinkDB table replicas in use by MSR are unhealthy, and an emergency repair is unsuccessful, you must restore the cluster from a backup.

Important

  • Use the same MKE cluster upon which you created the backup. If you restore on a different MKE cluster, the MSR resources will be owned by non-existent users, and thus you will not be able to manage the resources despite their being stored in the MSR data store.

  • Use the same version of the mirantis/dtr image that you used in creating the backup.

To restore MSR from a backup:

  1. Using the client bundle, run the following command to stop and remove any MSR container that is still running:

    docker run -it --rm \
    mirantis/dtr:2.9.16 destroy \
    --ucp-insecure-tls
    

    Note

    If the client bundle is not activated, you can run the command from an MSR node.

  2. Extract your backup:

    • If MSR is configured to store images on the local file system, run the following command:

      sudo tar -xf {{ image_backup_file }} -C /var/lib/docker/volumes
      
    • If MSR uses a different storage backend, follow the best practices recommended for that system.

  3. Use the mirantis/dtr restore command to perform MSR installation and complete it with the configuration that was created during backup.

  4. Load your MKE client bundle and run the following command:

    read -sp 'ucp password: ' <MKE-password>;
    
  5. Run the following command to restore MSR from your backup:

    docker run -i --rm \
    --env UCP_PASSWORD=<MKE-password> \
    mirantis/dtr:2.9.16 restore \
    --ucp-url <mke-url> \
    --ucp-insecure-tls \
    --ucp-username <mke-admin-username> \
    --ucp-node <hostname> \
    --replica-id <replica-id> \
    --dtr-external-url <msr-external-url> < {{ metadata_backup_file }}
    

    Note

    Refer to :ref:CLI Reference: mirantis/dtr restore <msr-cli-restore> for the supported command options.

  6. If you scan images in MSR, you must update the vulnerability database in the MSR UI. Refer to Enable MSR security scanning for more information.

After you successfully restore MSR, you can join new replicas as you would following a fresh installation.