Create, monitor, schedule, and restore ClickHouse backups using the Private API.
For manual backup operations without the API, see Backup and Restore.
Prerequisites
- ClickHouse Private API installed and accessible (e.g., via port-forward to
http://localhost:8080/)
- At least one ClickHouse cluster deployed (this guide uses
default-xx-01)
Create a Full Backup
The response includes a UUID identifying the backup.
Check Backup Status
Query a specific backup by UUID:
When the backup completes successfully, the status.state field returns Ready.
List All Backups
The endpoint supports query parameters for filtering and sorting. For example, to find the last successful backup:
Create Incremental Backups
Incremental backups only back up data that changed since a previous backup, forming a chain with a full backup as the starting point.
Back Up Specific Tables or Databases
Control what gets backed up using the databases and tables fields. Table names must be fully qualified (i.e., db.table).
Schedule Backups with a CronJob
Use a Kubernetes CronJob to automate backup creation:
This schedules a full backup daily at 2 AM. It assumes the Private API is reachable via http://clickhouse-private-api-airgap-management:8080.
Restore from a Backup
Via the API
The API exposes a restore endpoint that restores a backup onto a different target instance:
For safety, the API disallows restoration on the same instance. It is recommended to spin up a new cluster for the restore to avoid overloading the original.
Manual SQL Alternative
For fine-grained control, restore directly with SQL. For example, to restore a single database under a new name:
Manage Backup Lifecycle
S3 Lifecycle Policy
Use S3 lifecycle policies to transition and expire old backups automatically:
This example moves backups to Standard-IA after 7 days, to Glacier after 30 days, and deletes them after 90 days.
Backup Chain Integrity Warning
S3 lifecycle policies are not aware of incremental backup chains. If a full backup at the base of a chain is deleted while incremental backups still reference it, those incremental backups become unrestorable.
Ensure your retention period for full backups exceeds the time between full backup cycles. Regularly test that your backups can be restored. Last modified on August 7, 2026