A restore is performed by creating a Restore custom resource.

Important

  • Follow the instructions from this page for restoring rancher on the same cluster where it was backed up from. In order to migrate rancher to a new cluster, follow the steps to migrate rancher.

  • While restoring rancher on the same setup, the operator will scale down the rancher deployment when restore starts, and it will scale back up the deployment once restore completes. So Rancher will be unavailable during the restore.

Create the Restore Custom Resource

  1. In the Cluster Explorer, go to the dropdown menu in the upper left corner and click Rancher Backups.
  2. Click Restore.
  3. Create the Restore with the form, or with YAML. For creating the Restore resource using form, refer to the [ configuration reference and to the examples.
  4. For using the YAML editor, we can click Create > Create from YAML. Enter the Restore YAML.

    1. apiVersion: resources.cattle.io/v1
    2. kind: Restore
    3. metadata:
    4. name: restore-migration
    5. spec:
    6. backupFilename: backup-b0450532-cee1-4aa1-a881-f5f48a007b1c-2020-09-15T07-27-09Z.tar.gz
    7. encryptionConfigSecretName: encryptionconfig
    8. storageLocation:
    9. s3:
    10. credentialSecretName: s3-creds
    11. credentialSecretNamespace: default
    12. bucketName: rancher-backups
    13. folder: rancher
    14. region: us-west-2
    15. endpoint: s3.us-west-2.amazonaws.com

    For help configuring the Restore, refer to the configuration reference and to the examples.

  5. Click Create.

Result: The rancher-operator scales down the rancher deployment during restore, and scales it back up once the restore completes. The resources are restored in this order:

  1. Custom Resource Definitions (CRDs)
  2. Cluster-scoped resources
  3. Namespaced resources

Logs

To check how the restore is progressing, you can check the logs of the operator. Run this command to follow the logs:

  1. kubectl logs -n cattle-resources-system -l app.kubernetes.io/name=rancher-backup -f

Cleanup

If you created the restore resource with kubectl, remove the resource to prevent a naming conflict with future restores.