# Restoring Yugabyte Platform Using File Server Agent

You can restore Yugabyte platform using the file server agent.

## Before You Begin

You must back up the Yugabyte platform subclient using the file system agent before performing the restore operation.

### Procedure

1. From the Command Center navigation pane, go to Protect > Files.

   The file server Overview page appears.

2. Go to the Files tab.

3. From the file servers list, click the Yugabyte file server.

   the Yugabyte file server Overview page appears.

4. Go to Subclients tab , and then click a subclient.

   The subclient Overview page appears.

5. You can restore the Yugabyte anywhere platform using Commvault, by the following two options:

   1. Restore .tar file using the Commvault file system restore, and then run the Yugabyte anywhere platform restore command manually on the required Yugabyte anywhere platform or high availability (HA) node. If you want to run the restore using this option, complete the following:

      1. From the Recovery point tile, click Restore.

         The Backup Content page appears.

      2. Browse to the file to be backed up, and then click Restore.

         The Restore options page appears.

      3. From the Destination list, select the destination computer.

         The destination computer can be a Yugabyte anywhere platform or a HA node where you want restore the .tar file.

      4. Select a Restore type.

      5. Clear the Restore to original folder checkbox to restore the .tar file to a different destination path where you want to restore the .tar file.

      6. In the Destination path, either enter or browse the path where you want to restore the .tar file.

      7. In the No of streams box, enter the number of data streams to use in the restore operation.

      8. To access the data with saved user credentials, move the Impersonate user toggle key to right, and then enter the user credentials.

      9. Click Restore.

      10. After the .tar file is restored, run the Yugabyte platform restore command on the desired node.

          - For Replicated Installations

                ./yb_platform_backup.sh restore --input $[input_path] [--destination $[destination]]

            - The restore command restores the Yugabyte Anywhere content.
            - Input_path is the path where input.tar file is restored.
            - Destination is optional. It specifies the output location for data. The default path is /opt/yugabyte.

          - For Installations Using yba-installer

                sudo yba-ctl restoreBackup $[input_path]

            Input_path is the path to the restored input .tar file.

   2. Specify the Yugabyte platform restore command as post recovery script which runs after the .tar file is restored using the Commvault file system restore. If you want to perform the restore using this option, complete the following:

      1. From the Recovery point tile, click Restore.

         The Backup Content page appears.

      2. Browse to the file to be backed up, and then click Restore.

         The Restore options page appears.

      3. From the Destination list, select the destination computer.

         The destination computer can be a Yugabyte anywhere node or a HA node where you want restore the .tar file.

      4. Select a Restore type.

      5. Clear the Restore to original folder checkbox to restore the .tar file to a different destination path where you want to restore the .tar file.

      6. In the Destination path, either enter or browse the path where you want to restore the .tar file.

         Note

         The destination path must be similar to the input path to be used in the Yugabyte restore command.

      7. In the No of streams box, enter the number of data streams to use in the restore operation.

      8. To access the data with saved user credentials, move the Impersonate user toggle key to right, and then enter the user credentials.

      9. Click the Equivalent API, and then copy the payload.

         Note

         By default, only admin users can see the Equivalent API option. To make it available to tenant users, enable the showEquivalentApiButtonForTenantUsers additional setting. For more information, see Showing the Equivalent API Button for Tenant Users.

         - Edit the payload to include the below prePostOpts block in commonOpts section:

                "commonOpts": {
                   "notifyUserOnJobCompletion": $[true],
                   "prePostOpts":{
                       "postRecoveryCommand":"$[/yb-restore-script]"
                           }
                       }

         - The postRecoveryCommand* should be the path to the Yugabyte restore script file, and the Yugabyte restore command should include the path until the .tar file as outlined below :

           - For Replicated Installations

                 ./yb_platform_backup.sh restore --input $[/yba-restore/backup_24-07-29-05-04.tgz]

           - For Installations Using yba-installer

                 sudo yba-ctl restoreBackup $[/yba-restore/backup_24-07-30-01-08.tgz]

         - Using POSTMAN or any other equivalent software, execute the REST API.

           - Use the endpoint https://<cs-ip/hostname>//webconsole/api/Login(POST) with the following contents in the body:

                 "username": $[User name]
                 "password": $[password]

             Note

             The username is the username required to login to the Command Center, and the password is the Base64 encoded format of the corresponding user password.

         - Copy the generated token in the response. For example:

                QSDK 3caecb5e3d0cffbe7cee5b493a95325a038afe2d38ff0207dddb5eed27199e4cd1f5c5ef26a304321f7b6691802ed8280b2f38f6edf1d14239b7d3c13e0b09a2eb1fc560fc5bda67e507007737738d02b78c6163d20bfb86e1d06f60122644da3b7d32b0d813bf0b6b9355b4c965778286c2d6c36231b486c0b1d0942265dc4b461f976ca1b33fed98b030d51c067081683a00155a06190594816c46da4f76b761270555b587ade524a3c23bfe1186fd69805e0bac67e4d6765f9c119d36a0195ae0df2fdc910e414

         - Use the endpoint https://<cs-ip/hostname>/commandcenter/api/CreateTask(POST) with the equivalent API content in the body and the token generated as value of authorization key under headers, and then perform the restore which runs the Yugabyte platform restore command as a post-restore command.

## Cleaning up the Restore Location

If you want to remove the .tar files restored to the destination location, do the following:

- Either add the command to remove the contents in post restore script file, along with the Yugabyte restore command or remove the files manually.

## Troubleshooting

Check the Yugabyte logs on the Yugabyte anywhere node or HA node for troubleshooting.

×

Loading...