Skip to main content
This page provides information about how to take backups with revision history and restore from a point-in-time. You can create full or incremental backups :
  • Taking full backups with revision history allows you to back up every change made within the garbage collection period leading up to and including the given timestamp.
  • Taking incremental backups with revision history allows you to back up every change made since the last backup and within the garbage collection period leading up to and including the given timestamp. You can take incremental backups with revision history even when your previous full or incremental backups were taken without revision history.
You can configure garbage collection periods using the ttlseconds . Taking backups with revision history allows for point-in-time restores within the revision history.
If you are creating incremental backups as part of a , will ensure the backup revision data is not garbage collected, which allows you to lower the GC TTL. See for more detail.

Supported products

The feature described on this page is supported in CockroachDB self-hosted clusters. It is also available in CockroachDB Standard, CockroachDB Advanced, and CockroachDB Basic Cloud clusters when you are running self-managed backups. For a full list of features, refer to:

Create a backup with revision history

For guidance on connecting to Amazon S3, Google Cloud Storage, Azure Storage, and other storage options, read .

Point-in-time restore

RESTORE will only restore the latest data in an object (table, database, cluster), or the latest data as per an AS OF SYSTEM TIME restore. A restore will not include historical data even if you ran your backup with revision_history. This means that if you issue an AS OF SYSTEM TIME query on a restored object, the query will fail or the response will be incorrect because there is no historical data to query.
If the full or incremental backup was taken with revision history, you can restore the data as it existed at an arbitrary point-in-time within the revision history captured by that backup. Use the clause to specify the point-in-time. Additionally, if you want to restore a specific incremental backup, you can do so by specifying the end_time of the backup by using the clause. To find the incremental backup’s end_time, use . If you do not specify a point-in-time, the data will be restored to the backup timestamp; that is, the restore will work as if the data was backed up without revision history.
To view the available backup subdirectories you can restore from, use .

See also