cbbackupmgr

      +
      cbbackupmgr is a tool for managing the backup and restore of Couchbase-Server data.

      Understanding cbbackupmgr

      The cbbackupmgr tool backs up and restores data, scripts, configurations, and more. It allows large data sets to be managed with extremely high performance. Use of AWS S3 storage is supported.

      Only Full Administrators can use cbbackupmgr; which is available in Couchbase Server Enterprise Edition only. Note that cbbackupmgr is not backward compatible with backups created by means of cbbackup.

      Note that in Couchbase Enterprise Server 7.2 and after, cbbackupmgr is available in a tools package that must be downloaded. See Server Tools Packages.

      Planning for Disaster Recovery

      Backup and restore capabilities are critical to an overall Disaster Recovery Plan, and ensuring thereby business continuity. Administrators are therefore recommended to define plans for both Recovery Time Objective (RTO) and Recovery Point Objective (RPO), and make use of cbbackupmgr correspondingly.

      Backup Repositories

      All backup is stored in and recovered from a Backup Repository. In turn, a Backup Repository is stored in a Backup Archive on the filesystem. Each backup job in the Backup Repository stores its backup in two ways:

      • All bucket data is stored in a small, secondary database.

      • All bucket creation scripts and configuration files are stored on the file system, as files.

      What’s Backed Up

      By default, backups include your database’s data and metadata.

      You can change what the tool backs up and restores by using arguments to the cbbackupmgr config command. For example, if you only want to back up your cluster’s metadata, use the --disable-data command line flag when configuring your backup repository. You may to choose to use this flag if you want to transfer settings to a new database cluster. When you use this flag, cbbackupmgr backs up just the following:

      • analytic collections and indexes for local links and synonyms

      • bucket configuration

      • eventing functions

      • full-text Search indexes and aliases

      • GSI indexes

      • Query SQL++ UDFs

      • scopes and collections definitions (Couchbase Server version 7.6 and later)

      • views

      cbbackupmgr does not back up query function libraries such as user-created JavaScript libraries. You must back up these libraries separately.

      Another useful flag is --enable-users which backs up users and user groups. Users and groups are not backed up by default. This option is useful for preventing the loss of users and groups in case of disaster.

      Backups that include users contain the user’s hashed passwords.

      Other flags let you exclude specific metadata, or select a subset of data to back up. See cbbackupmgr config for a list of the arguments you can use to control what cbbackupmgr backs up.

      You can also use command line flags to control how the cbbackupmgr restore command restores data. For example, use --overwrite-users to have cbbackupmgr overwrite existing users and groups in the database if the backup contains a matching user or group. By default, cbbackupmgr does not overwrite existing users in the database. Instead, it restores just the users in the backup that do not exist in database. See cbbackupmgr restore for a list of the arguments you can use to control what cbbackupmgr restores.

      Tool Locations

      When installed as part of the Couchbase Server install, cbbackupmgr tool is stored with all other tools in the following per platform locations:

      Table 1. Backup Tool Locations
      Operating system Directory locations

      Linux

      /opt/couchbase/bin/cbbackupmgr

      Windows

      C:\Program Files\Couchbase\Server\bin\cbbackupmgr

      Assumes default installation location

      Mac OS X

      /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/cbbackupmgr

      How the Backup and Restore Tool Works

      By default, the cbbackupmgr tool performs incremental backups to back up only the new data. However, on a new cluster and for the first time, this tool generates a full backup. Each of the subsequent, incremental backups take a fraction of the time taken by the full backup.

      Archive Repository

      The backup archive is a directory that contains a set of backup repositories as well as logs for the backup client. The backup directory should be modified only by the backup client, and any modifications that are not done by that client might result in a corruption of backup data.

      Only one backup client can access the backup archive at one time. If multiple instances of the backup client are running on the same archive at the same time, this might result in corruption. To prevent such corruption instances, you may be required to create multiple backup archives depending on your use case.

      Version Compatibility

      For 6.5 and all later versions, cbbackupmgr can be used to back up data either from a cluster running its own version, or from a cluster running a prior, compatible version. For example, the 6.6.0 tool can back up data from a cluster running 6.6.0, 6.5.x, 6.0.x, or 5.5.x. It can also be used to restore to any of those versions data previously backed up from any of those versions.

      The following table lists the compatible cluster-versions for each version of cbbackupmgr. Unless otherwise specified, backup and restore apply both to local and to cloud data.

      Table 2. Compatibility Requirements for Backup and Restore

      cbbackupmgr version

      7.6

      7.2

      7.1

      7.0

      6.6

      6.5.x

      6.0.x

      5.5.x

      7.6

      7.2

      7.1

      ✓*

      7.0

      ✓*

      ✓*

      6.6.0 and above

      ✓*

      ✓*

      ✓*

      6.5

      6.0.x

      5.5.x

      * For local backup only — not for cloud.