CockroachDB provides enterprise-grade backup and restore capabilities to protect your data. Learn how to create full and incremental backups, schedule automated backups, and restore data when needed.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cockroachdb/cockroach/llms.txt
Use this file to discover all available pages before exploring further.
Backup Types
Full Backup
Complete snapshot of all data at a specific point in time
Incremental Backup
Only changes since the last backup, reducing time and storage
Revision History
Point-in-time recovery with historical data versions
Scheduled Backups
Automated backups running on a regular schedule
Creating Backups
Full Database Backup
Create a complete backup of your entire database:Full Cluster Backup
Specific Database Backup
Table-Level Backup
Full backups create a new backup in the specified location. Use
BACKUP INTO LATEST for incremental backups.Incremental Backups
Create incremental backups to capture only changes since the last backup:Incremental Backup
Backup Destinations
CockroachDB supports multiple storage backends for backups:Scheduled Backups
Automate backups with schedules:Create Backup Schedule
Schedule Options
Common Schedule Expressions
Common Schedule Expressions
@hourly: Every hour@daily: Every day at midnight UTC@weekly: Every Sunday at midnight UTC'*/15 * * * *': Every 15 minutes (cron format)'0 2 * * *': Every day at 2 AM UTC'0 0 * * 0': Every Sunday at midnight UTC
Managing Schedules
View All Schedules
Pause a Schedule
Resume a Schedule
Alter a Schedule
Drop a Schedule
Backup Options
Enhance your backups with additional options:Backup with Revision History
Revision history enables point-in-time restore (PITR) capabilities, allowing you to restore to any moment within the backup’s coverage.
Encrypted Backup
Detached Backup
revision_history
Captures historical versions of data for point-in-time recovery
encryption_passphrase
Encrypts backup data for security compliance
detached
Returns immediately without waiting for backup completion
execution_locality
Runs backup on specific nodes based on locality
Restoring from Backups
Full Database Restore
Restore Entire Cluster
Restore Specific Database
Restore Specific Tables
Point-in-Time Restore
Restore to a specific timestamp using revision history:PITR Restore
Identify Target Time
Determine the exact timestamp to restore to, either from application logs or monitoring data.
Restore Options
Restore to Different Database
Restore with Decryption
Skip Missing Foreign Keys
Viewing Backup Details
List Backups in Location
Show Backup Contents
Check Backup Validity
Monitoring Backup Jobs
View Running Jobs
View Job Details
Cancel a Backup Job
Backup Best Practices
Use Incremental Backups
Implement a strategy with full weekly backups and daily/hourly incrementals to optimize storage and backup windows.
Enable Revision History
Use
revision_history for critical databases to enable point-in-time recovery.Encrypt Sensitive Data
Always encrypt backups containing sensitive information using
encryption_passphrase.Test Restores Regularly
Periodically restore backups to a test environment to verify data integrity and restore procedures.
Distribute Backup Storage
Store backups in a different region or cloud provider than your primary cluster for disaster recovery.
Automate with Schedules
Use scheduled backups instead of manual processes to ensure consistency and reduce human error.
Backup Strategy Example
Recommended Enterprise Backup Strategy
Recommended Enterprise Backup Strategy
- Daily incremental backups for quick recovery
- Weekly full backups for long-term retention
- Revision history for point-in-time recovery
- Encrypted archive backups for compliance
Troubleshooting
Backup Failures
Permission Errors
Verify cloud storage credentials and IAM permissions
Timeout Issues
Increase backup job timeout or split into smaller backups
Storage Quota
Check available storage space in backup destination
Network Connectivity
Ensure nodes can reach backup storage endpoints
Restore Failures
Check Backup Integrity
Next Steps
Security
Secure your backups and cluster
Upgrade
Upgrade CockroachDB versions
Scaling
Scale your cluster capacity