Restore a Backup

      +
      You can restore a backup to the same database where it was created or another database in the same organization.

      Use the procedures on this page to restore data from a bucket backup. For more information about how to create and manage backups, see Manage Backups. For more information about how backups work in Couchbase Capella, see Backup and Restore Data.

      Prerequisites

      Permissions Required

      To view and restore bucket data from a backup:

      • You need the Project Owner role for the project with the database that created the backup and the project containing the destination database for the restore. If you have the Organization Owner role, you already have the Project Owner role for all projects in the organization.

      • The source database that created the bucket backup must still exist.

      • You can only restore backups to a database running the same major version or later as the database that created the backup.

      • You can only restore data to an existing bucket with the same name and conflict resolution methods as the bucket from the backup.

      • Owing to the way backups are stored in Capella, you can only restore to a bucket in the same Cloud Service Provider (CSP) as the one used to create the backup — such as from Azure to Azure. Should you need a backup that can be restored across different CSPs, you can use a locally-stored backup — see Downloadable backups, or the cbbackupmgr command line tool.

      Restore a Bucket

      Couchbase recommends that you only restore data from bucket backups in worst-case scenarios. You should use other recovery methods, such as XDCR replication from a redundant database as the primary recovery method.

      Capella resolves any conflicts during the restore with the conflict resolution method configured for the buckets. For example, if a key-value pair in the target bucket is newer than the one in the backup, then the one from the backup isn’t restored unless otherwise specified in the restore settings.

      1. Open the Backup page for your database:

        1. With the Projects tab in your organization open, click the project with the database you want to work with.

        2. With the Databases tab open, select your database.

        3. Click the Backup tab.

      2. Select the bucket you want to restore.

      3. Click Restore for the backup you want to restore.

        Clicking the From Date date picker allows you to select a previous date for a backup cycle or on-demand backup.
      4. Specify the Destination Database.

        The restore location can be the current database (chosen by default) or a different database in your organization. If you select Restore to a different database, the Database list appears.

        1. When restoring to a different database, use the Database list to select the database that’s the destination of the restore. You can only restore to a database in the same organization.

      5. Choose the Services to Restore.

        1. Select each service you want to restore. By default, all options are selected. You must select at least one service.

      6. (Optional) Apply Other Options.

        1. Overwrite Documents From Backup

          When enabled, this option overwrites later versions of documents with earlier versions from the backup. By default, this option is deselected.

        2. Automatically Remove Deleted Collections

          When enabled, this option removes empty collections from the restore. By default, this option is deselected.

        3. Filter Keys

          Use this field to enter a regular expression (RE2) to filter keys. You can use Filter Keys to restore a specified portion of your dataset from the backup.

        4. Filter Values

          Use this field to enter a regular expression (RE2) to filter values. You can use Filter Values to restore a specified portion of your dataset from the backup.

        5. Include Data

          Use this field to include only specific buckets, scopes, or collections from the backup. Use this field to restore only specific data containers. Use the following format for Include Data items: bucket.scope, or bucket.scope.collection.

          As buckets can contain periods, they must be escaped: my\.bucket.my-scope.

          Included data can only be specified once and can’t overlap, for example bucket1 and bucket1.scope1.

        6. Exclude Data

          Use this field to define any buckets, scopes, or collections you want to exclude from the restore. Use this field to restore all data containers except the items in this field. Excludes are defined as follows: bucket.scope, and bucket.scope.collection.

      7. To start the restore, click Restore Backup.

        There can be a delay while Capella schedules the restore. Once the restore starts, its status appears on the Database page. The restore automatically recreates any missing buckets. Capella also adds backup and restore events to the Activity Log.

      Restore Indexes

      Permissions Required

      To access indexes in the Couchbase Capella UI:

      If GSI indexes were included in the bucket you restored, they’re automatically restored in a round-robin fashion among the current nodes running the Index Service. These indexes are created, but not built.

      Indexes are created and not built because Couchbase Capella doesn’t know the optimal index topology ahead of time. By not building the indexes, Capella gives you the option to manually move each index between nodes and build them yourself. However, if you find the automatic index distribution acceptable, you can use the Capella UI to rebuild each index.

      To Rebuild an Automatically-Restored GSI Index
      1. Open the Indexes page for your database:

        1. With the Projects tab in your organization open, select the project with the database you want.

        2. With the Databases tab open, select your database.

        3. Click the Data Tools tab.

        4. In the navigation menu, click Indexes.

      2. Each restored index displays a status of Created. In the Status column, click the Play icon for each index you want to rebuild.

        The 'Tools > Indexes' tab showing multiple indexes with a status of 'Created' with Play icons.

        Each index you build displays the Ready status when the process is complete.

      View and Restore a Downloaded Backup

      When downloaded, you can unzip a zip archive file and use the Couchbase Server cbbackupmgr utility to view, examine, or restore the contents of the backup repository.

      For more information on the download file, see About the Zip Archive File.

      For more information about the cbbackupmgr utility, see cbbackupmgr in Command Line Tools.

      If you are running cbbackupmgr commands against Couchbase Capella databases with the database access credentials, there are some cbbackupmgr disable options that you must use. These restrictions do not apply if you are running cbbackupmgr commands against your self-managed databases, using the downloaded backup archive.