Restore from an MSR 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.
Restore MSR from a backup for Kubernetes¶
To restore MSR from a backup:
- Set up an MSR instance to serve as the restore target. 
- Verify that the MSR version in use by the cluster matches the one used to create the backup. 
- Extract your backup: - If MSR is configured to store images on the local file system, run the following command: - sudo tar -xf image-backup.tar -C /var/lib/docker/volumes 
- If MSR uses a different storage back end, follow the best practices recommended for that system. 
 
- Use the msr restore command to restore MSR metadata from a previously created backup. The command is present in any API Pod and can be run using the kubectl exec command. - The following is an example of restoring onto an MSR installation named - mymsr. The backup contents are streamed from standard input, which receives its data from the local file- backup.tar.- kubectl exec -i deployment.apps/<msr-installation-name> -- msr restore - < backup.tar 
- Register MSR with eNZi (auth service): - Run the msr auth register admin command: - kubectl exec -i deployment.apps/mymsr-api -- msr auth register --username admin -p password https://mymsr-enzi:4443/enzi 
- Restart MSR Pods: - kubectl rollout restart deployment mymsr-api mymsr-enzi-api mymsr-garant mymsr-registry 
 
- 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.
Restore MSR from a backup for Swarm¶
To restore MSR from a backup:
- Set up an MSR instance to serve as the restore target. 
- Verify that the MSR version in use by the cluster matches the one used to create the backup. 
- Extract your backup: - If MSR is configured to store images on the local file system, run the following command: - sudo tar -xvf ~/msr-image-backup.tar -C /var/lib/docker/volumes/msr_msr-storage 
- If MSR uses a different storage back end, follow the best practices recommended for that system. 
 
- Use the msr restore command to restore MSR metadata from a previously created backup. The command is present in any API container and can be run using the docker exec command. - The following is an example of restoring onto an MSR installation named - msr. The backup contents are streamed from standard input, which receives its data from the local file- backup.tar.- docker container exec -i $(docker ps -q --filter "name=msr-api") msr restore - < backup.tar 
- Run the msr auth register admin command: - docker container exec -i $(docker ps -q --filter "name=msr-api") msr auth register --username <MSR admin user> -p <MSR admin password> https://<node's ID>.msr-enzi-api:4443/enzi 
- 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.