- The frequency of the backups to meet requirements.
- The retention of the backups to set how long Cockroach Labs retains the backups.
In addition to managed backups, you can take manual backups to your own storage bucket with self-managed backups. Refer to the page.
Managed backup settings
Configurable managed backup settings are available in all of CockroachDB on Standard and Advanced clusters.
Frequency
You can configure how frequently Cockroach Labs takes backups, which will determine the cluster’s . You can set backup frequency to one of the following options:- 5 minutes
- 10 minutes
- 15 minutes
- 30 minutes
- 1 hour (default)
- 4 hours
- 24 hours
Retention
You can set your retention duration once. After you have adjusted the retention, the duration will only apply to new backups. The available retention options are:- 2 days
- 7 days
- 30 days (default)
- 90 days
- 365 days
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 Standard cluster and be completely wiped of data.
- You cannot restore a backup of a multi-region database into a single-region database.
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 ProgressorComplete. - 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.
Modify backup settings
Following a change to the backup frequency or retention setting, the cluster will take a full backup immediately, which may impact CPU usage on the cluster. If you are disabling managed backups, the cluster will not take a backup following the change. Before modifying cluster backup settings, review details on backup settings for Standard and Advanced clusters. Click on Settings and the Backup Settings module will open. The Enable backups switch allows you to enable or disable backups. To modify the frequency of backups, click on the dropdown under Schedule backups every. This will display the following options to select:- 5 minutes
- 10 minutes
- 15 minutes
- 30 minutes
- 1 hour (default)
- 4 hours
- 24 hours
- 2 days
- 7 days
- 30 days (default)
- 90 days
- 365 days
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.
- Find the cluster backup on the Backup Recovery page.
- Click Restore for the cluster you want to restore. The Restore cluster module displays with backup details.
- You can restore a backup to the same cluster or a different Standard cluster. The target cluster must already be created. Select the desired target cluster under Restore to cluster and click Continue
- Review the restore details then click Restore.
Cloud API
You can use the to view and modify managed backup settings, view managed backups, or restore clusters from a managed backup.The associated with the secret key must have the role.
Get information on backup settings
To retrieve information about a specific cluster, make aGET request to the /v1/clusters/{cluster_id}/backups-config endpoint.
- is the unique ID of the cluster. This ID is written in a UUID format similar to
f78b7feb-b6cf-4396-9d7f-494982d7d81eand is returned by a . You can also find the cluster ID in the Cloud Console, in the URL of the single cluster overview page:https://cockroachlabs.cloud/cluster/{your_cluster_id}/overview. - is your API key. Refer to for more details.
- shows whether managed backups are enabled or disabled.
- is how often the managed backup will run in minutes.
- is the number of days Cockroach Labs will retain the managed backup in storage.
Modify backup settings on a cluster
Following a change to the backup frequency or retention setting, the cluster will take a full backup immediately, which may impact CPU usage on the cluster. If you are disabling managed backups, the cluster will not take a backup following the change. Before modifying cluster backup settings, review details on backup settings for Standard and Advanced clusters. To configure the frequency and retention of managed backups, send aPUT request to the /v1/clusters/{cluster_id}/backups-config endpoint.
-
is the unique ID of the cluster. This ID is written in a UUID format similar to
f78b7feb-b6cf-4396-9d7f-494982d7d81eand is returned by a . You can also find the cluster ID in the Cloud Console, in the URL of the single cluster overview page:https://cockroachlabs.cloud/cluster/{your_cluster_id}/overview. -
controls whether managed backups are enabled or disabled. If you are disabling managed backups, you cannot set backup frequency or retention. Possible values are:
true,false. -
determines how often the managed backup will run in minutes. Possible values are:
5,10,15,30,60,240(4 hours),1440(24 hours). -
sets the number of days Cockroach Labs will retain the managed backup in storage. You can change
retention_daysfor the cluster once (whether in the Cloud API or Cloud Console). Possible values are:2,7,30,90,365. If has previously been modified (in the Cloud API or Cloud Console), you receive the message “cluster already has a retention policy set, open a support ticket to change it”. To modify the setting again, contact the . - is your API key. Refer to for more details.
View managed backups
To view a list of managed backups on a cluster with timestamps and their respective IDs, send aGET request to the /v1/clusters/{cluster_id}/backups endpoint:
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 aPOST request to the /v1/clusters/{cluster_id}/restores endpoint of "type": "CLUSTER":
source_cluster_id. To restore a specific backup, include the backup_id field and specify a backup ID from the managed backups list:
source_cluster_id.
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 aGET request to the /v1/clusters/{cluster_id}/restores/{restore_id} endpoint where restore_id is the id from the JSON response:
CockroachDB Cloud Terraform provider
You can use the to specify managed backup settings in Standard clusters. In yourmain.tf Terraform configuration file, use the backup_config attribute on the cockroach_cluster resource to modify the settings of managed backups. For example:
backup_config attribute:
enabledcontrols whether managed backups are enabled or disabled. If you modify theretention_dayssetting even when managed backups are disabled, this will use the one possible change forretention_days. Possible values for theenabledsetting are:trueorfalse.frequency_minutesdetermines how often the managed backup will run in minutes. Possible values are:5,10,15,30,60,240(4 hours),1440(24 hours).retention_dayssets the number of days Cockroach Labs will retain the managed backup in storage. You can changeretention_daysfor the cluster once (whether in Terraform, the Cloud API, or the Cloud Console). Possible values are:2,7,30,90,365. Note that:-
If the initial value of the
retention_daysattribute is the default value30, you’ll be able to modify the backup retention setting once more. -
If the initial value is not the default, you will not be able to modify
retention_daysagain. You can refrain from includingretention_daysin the Terraform configuration and instead manage the retention in the Cloud Console. To modify the setting again, contact the . For more details on modifyingretention_days, refer to the Updating Backup Retention documentation in the Terraform provider for CockroachDB Cloud Repository.
-
If the initial value of the

