Skip to main content

How can we help you?

Druva Documentation

Restore Workflow Using Command Line Interface

Overview

Upon creating an Application Group, Druva Backup Operator registers the Application Group with the backup catalog and installs a secret containing the Application Group credentials, which are required to initiate the backup and create a Restore Point. Once the backup generates successfully, the Restore Point is created in the same namespace as the Application Group. To initiate the Application Group restore from a Restore Point, you will need to retrieve the list of available Restore Points.

Note: You can choose to list restore points for a specific application group, or all restore points within a namespace. You may also display the Restore Points across all namespaces within a cluster.

Procedure

  1. Retrieve Restore Points.
    To the list of available Restore points, run the following command:

$kubectl druva get restorepoint -n <namespace>

A sample output displayed is shown below:

NAME                                   APPLICATIONGROUPNAME   APPLICATIONGROUPID                     APPLICATIONGROUPRECIPE   STARTEDAT              COMPLETEDAT
8f969763-a8bb-4992-ac27-2145b5ece6fe   mysqlappgroup          081cbd64-79bb-4392-a1fb-be32f1b02e78                            2021-10-21T13:44:45Z   2021-10-21T13:47:41Z

2. Initiate Restore Access Request:
To initiate a restore for a Restore Point within a specific namespace, you will first need to create the Restore Access Request and generate the Restore Access Token:

To create the Restore Access Request, run the following command:

druvactl create restoreaccessrequest <name> <restorepoint> -n <namespace>

This initiates the request to generate the Restore Access Token, which you will need to provide to create the restore. The available flags include:
--timeout string indicates the timeout (the default timeout string is “0s”)
--recipe string indicates the recipe used to back up the Application Group

A sample output is shown below:

kubectl druva create restoreaccessrequest -n mysqlapp resaccess 8f969763-a8bb-4992-ac27-2145b5ece6fe --region ap-south-1 --cluster-id 610daaf0-f936-4a24-9241-abcf535ade9e
restoreaccessrequest.backup.druva.com/resaccess created

Note: At any point, you may use the help (-h or –help) flag for a list of valid Helm commands. Use help for restoreaccessrequest for valid commands to initiate the Restore Access Request.

3. Verify that the RestoreAccess request is created:

$kubectl druva get restoreaccessrequest -n mysqlapp

4. Fetch the token from RestoreRequestAccess:

$kubectl get restoreaccessrequest -n mysqlapp -o yaml | grep accessToken

A sample output displayed is shown below:

accessToken: C/lrS22fWNG3b60z4TKBK+2zvmEyaBJ20EnScU99VmpnXrOdTYDgD6XY8ExVsVI6rLBKW7kHsOI67XDqmkxF1Gyvz8Ycdat/cFX0akY+hdQWgP4HESc6llanqzjQwkCI+RK6IEuWdoYJB+9zRyYg3RqUf6Ptja/X1wlsncSOVq8=?Im3kxgIoaBPHHbnOUa8696/cgpZkRnYsc0zYZZbWcc+Ao8JLLL9JMdIMtiRmBxGSHQ6fxninkxzVN+W4k/1jlpHW+BaE69T01+okoJWzCADJWj0O/CPP0BNUuCeQNfxP83Eo2/dPYMuUsczcbQh8LZeBXwbxYntoDMnt+8AaiFLLgK9C4lMgrGE7pplleeVnWIHUyzAJPo4WTV5zoeQpp6jXn7I6rmuY8p7J3fDmIeXu2wWQbIQkvM98Ch/Bj7lpfsyk2KrX6lCiqNHqjxMYaue9n2juyS5TlW98Uw7rZcVO8veal2dU9URoo0EtbI8mStmE6FC5oFZzXuz0kLMWml2UFOJKN0xguHR5htY+4Qmee0m86uPU6U5jGAyjlhV6kXtZgUPHQiHKcmNmwYoPs2g1NjWraUt5LhRFgSwgxImwqX0rN9WWEv3m/N1Estr3Iu5MPVFKOlxQ0l38DtAjGJmIbrAda264VxdiKqGo1M15XCYiIXo+HnoA85MzQ9x6KIQ/vdv2NqlQGLrMoXwTuS3XdOEbd96YSgcCiU+muXOgwVd7dV9IpvI4CkPrfKNU421bTeOzLz35wJNN8/kqS0WWwjqQJeJ553Jxa8VUNe2JQaJan4ulBACu/JJKg+nvabqc51pUtoW+J3FluTGix2p6EUeBob0MDTltVTWDcyOBzvswt6fPqwKa308FXo4tnDa29Efo7cuxboxVi3YuKharpbPSFOLPR5bCeQ8h0LDYK3FMap7XhBwhvy0BaLe6

5.  Copy the Restore Access Token generated.

6. Initiate Restore:
      To initiate a restore for a restore point within a different namespace, run the following command:

druvactl create restore -n <namespace> <name> <restoreaccesstoken>

The available flags include:
--method string indicates the method used to backup persistent volumes (the default method string is Snapshot)
--recipe string indicates the recipe used to back up the Application Group

A sample output displayed is shown below:

druvactl create restore mysqlapp -n mysqlapp-restore C/lrS22fWNG3b60z4TKBK+2zvmEyaBJ20EnScU99VmpnXrOdTYDgD6XY8ExVsVI6rLBKW7kHsOI67XDqmkxF1Gyvz8Ycdat/cFX0akY+hdQWgP4HESc6llanqzjQwkCI+RK6IEuWdoYJB+9zRyYg3RqUf6Ptja/X1wlsncSOVq8=?Im3kxgIoaBPHHbnOUa8696/cgpZkRnYsc0zYZZbWcc+Ao8JLLL9JMdIMtiRmBxGSHQ6fxninkxzVN+W4k/1jlpHW+BaE69T01+okoJWzCADJWj0O/CPP0BNUuCeQNfxP83Eo2/dPYMuUsczcbQh8LZeBXwbxYntoDMnt+8AaiFLLgK9C4lMgrGE7pplleeVnWIHUyzAJPo4WTV5zoeQpp6jXn7I6rmuY8p7J3fDmIeXu2wWQbIQkvM98Ch/Bj7lpfsyk2KrX6lCiqNHqjxMYaue9n2juyS5TlW98Uw7rZcVO8veal2dU9URoo0EtbI8mStmE6FC5oFZzXuz0kLMWml2UFOJKN0xguHR5htY+4Qmee0m86uPU6U5jGAyjlhV6kXtZgUPHQiHKcmNmwYoPs2g1NjWraUt5LhRFgSwgxImwqX0rN9WWEv3m/N1Estr3Iu5MPVFKOlxQ0l38DtAjGJmIbrAda264VxdiKqGo1M15XCYiIXo+HnoA85MzQ9x6KIQ/vdv2NqlQGLrMoXwTuS3XdOEbd96YSgcCiU+muXOgwVd7dV9IpvI4CkPrfKNU421bTeOzLz35wJNN8/kqS0WWwjqQJeJ553Jxa8VUNe2JQaJan4ulBACu/JJKg+nvabqc51pUtoW+J3FluTGix2p6EUeBob0MDTltVTWDcyOBzvswt6fPqwKa308FXo4tnDa29Efo7cuxboxVi3YuKharpbPSFOLPR5bCeQ8h0LDYK3FMap7XhBwhvy0BaLe6

7. Display Restore Status
To display the status of all restores jobs within that namespace, use the get restore command.

 druvactl get restore -n <namespace> <name> <restoreaccesstoken>

A sample output displayed is shown below:

NAME                                           RESTOREID                               STARTEDAT              STAGE      STATE       UPDATEDAT              COMPLETEDAT
dbo-f52e1295-515d-4515-a806-691a001bd575       8f969763-a8bb-4992-ac27-2145b5ece6fe    2021-10-21T13:44:45Z   Finalize   Completed   2021-10-21T13:47:40Z   2021-10-21T13:47:40

This will generate the list of successful restores of all application group(s) within that namespace.

Note: If the last initiated restore has failed, then only the last successful restores of application groups within that namespace will be displayed.