Skip to main content
are automated backups of CockroachDB Cloud clusters that are stored by Cockroach Labs in cloud storage. By default, Cockroach Labs takes and retains managed backups in all Cloud clusters. In Standard and Advanced clusters, you can adjust the default managed backup settings to meet your organization’s disaster recovery requirements. This page describes managed backups in Basic clusters, which have a default non-configurable schedule.
In addition to managed backups, you can take manual backups to your own storage bucket with self-managed backups. Refer to the page.
Cockroach Labs will take a managed backup every 24 hours. By default, managed backups will be retained for 30 days in Basic clusters. When a Basic cluster is deleted, or the customer’s agreement with Cockroach Labs has terminated, managed backups taken on the cluster will be retained for 30 days, after which the backups will be deleted. For details on viewing and managing the backups, refer to the Cloud Console section.

Upgrades and downgrades

If you have upgraded from a Basic cluster to a Standard cluster, the existing backup schedules will still apply, but you can then configure the frequency and retention of future managed backups in the Standard cluster. If you have downgraded from a Standard cluster to a Basic cluster, existing managed backups will be retained for the configured retention duration. The default managed backups in Basic clusters will be taken every 24 hours and have a 30-day retention.

Considerations

  • Every backup will be stored entirely in a single region, which is chosen at random from the list of cluster regions at the time of cluster creation. This region will be used indefinitely to store backups.
  • You can perform a cross-cluster restore across clusters in the same organization. However, the target cluster must also be a Basic cluster and be completely wiped of data.
For details on the storage costs of managed backups, refer to the page.

Required permissions to restore managed backups

To restore a managed backup successfully in CockroachDB Cloud, you must have the appropriate on both the source and destination clusters:
  • You must have either the or role on the destination cluster, or at the . Without one of these roles, the restore job will fail.
  • You must also have either the or role on the source cluster (the cluster from which the backup was taken), or at the . If you do not have the required permissions on the source cluster, the restore will fail.
Organization-level permissions take precedence over cluster-specific permissions. If you have the appropriate role at the organization level, you are authorized to perform restore operations on all clusters within that organization.

Cloud Console

View backups

Click on Backup and Restore in the Data section of the left-side navigation to access the Backup Recovery page. This page displays a list of your cluster backups. Use the calendar drop-down to view all backups taken on a certain date. For each backup, the following details display:
  • Data From: The date and time the backup was taken.
  • Status: The backup’s status, In Progress or Complete.
  • Expires In: The remaining number of days Cockroach Labs will retain the backup.
  • Restore: Restore a particular cluster backup, click Restore in the corresponding row.

Restore a cluster

Before a cluster can be restored from a managed backup, the destination cluster must be completely wiped of data. A cluster restore job fails if the destination cluster contains any databases/schemas/tables.
Performing a restore will cause your cluster to be unavailable for the duration of the restore. All current data is deleted, and the cluster will be restored to the state it was in at the time of the backup. To restore a cluster:
  1. Find the cluster backup on the Backup Recovery page.
  2. Click Restore for the cluster you want to restore. The Restore cluster module displays with backup details.
  3. You can restore a backup to the same cluster or a different Basic cluster. The target cluster must already be created. Select the desired target cluster under Restore to cluster and click Continue
  4. Review the restore details then click Restore.

Cloud API

You can use the to view managed backups or restore clusters from a managed backup.
The associated with the secret key must have the role.

View managed backups

To view a list of managed backups on a cluster with timestamps and their respective IDs, send a GET request to the /v1/clusters/{cluster_id}/backups endpoint:
If the request is successful, the client recieves a JSON response listing backups with their unique . The timestamp describes the system time of the cluster when the backup was created:

Restore from a managed backup

You can use the /v1/clusters/{destination_cluster_id}/restores endpoint to restore the contents of a managed backup to a specified destination cluster. On Standard and Basic clusters, managed backups can only be restored at the cluster level into the same cluster or a different cluster of the same plan type in the same organization.

Restore a cluster

Before a cluster can be restored from a managed backup, the destination cluster must be completely wiped of data. A cluster restore operation fails if the destination cluster contains any databases/schemas/tables. To restore a cluster to a recent managed backup, send a POST request to the /v1/clusters/{cluster_id}/restores endpoint of "type": "CLUSTER":
By default, the restore job uses the most recent backup stored within the last 7 days on the cluster specified in source_cluster_id. To restore a specific backup, include the backup_id field and specify a backup ID from the managed backups list:
To restore a cluster backup into a different cluster, ensure that the destination cluster is created with the same plan type (Basic, Standard, or Advanced) and contains no databases/schemas/tables. Send the restore request to the destination cluster ID, specifying the ID of the source cluster as source_cluster_id.
You can specify additional options for the restore job in the restore_opts object. For more information, see the API endpoint documentation. If the request is successful, the client recieves a JSON response that describes the request operation:

Get status of a restore job

To view the status of a restore job using the cloud API, send a GET request to the /v1/clusters/{cluster_id}/restores/{restore_id} endpoint where restore_id is the id from the JSON response:
If the request is successful, the client recieves a response containing JSON describing the status of the specified request operation: