BACKUP keyword
BACKUP - start and abort incremental backups to object storage.
Backup operations are only available in QuestDB Enterprise.
Looking for a detailed guide on backup creation and restoration? Check out our Backup and Restore guide!
Syntax
BACKUP DATABASE;
BACKUP ABORT;
BACKUP DATABASE
Starts a new incremental backup. Returns immediately with the backup timestamp. The backup runs asynchronously in the background.
BACKUP ABORT
Aborts a running backup. Returns a single row:
| Column | Type | Description |
|---|---|---|
status | VARCHAR | aborted or not running |
backup_id | TIMESTAMP | Timestamp of aborted backup, or NULL |
Example when backup was running:
| status | backup_id |
|---|---|
| aborted | 2024-01-15T10:30:00.000000Z |
Example when no backup was running:
| status | backup_id |
|---|---|
| not running | NULL |
Monitoring backups
Use the backups() table function to monitor backup progress and history:
SELECT * FROM backups();
Returns:
| Column | Type | Description |
|---|---|---|
status | VARCHAR | Current status (see below) |
progress_percent | INT | Completion percentage (0-100) |
start_ts | TIMESTAMP | When the backup started |
end_ts | TIMESTAMP | When the backup completed (NULL if running) |
backup_error | VARCHAR | Error message if backup failed |
cleanup_error | VARCHAR | Error message if cleanup failed |
Status values
backup in progress, backup complete, backup failed, cleanup in progress,
cleanup complete, cleanup failed
See status values in the Backup guide for descriptions and recommended actions.
Examples
Start a backup:
BACKUP DATABASE;
Result:
| backup_timestamp |
|---|
| 2024-08-24T12:34:56.789123Z |
Check current backup status:
SELECT status, progress_percent FROM backups() ORDER BY start_ts DESC LIMIT 1;
Configuration
Backups must be configured before use. At minimum:
backup.enabled=true
backup.object.store=s3::bucket=my-bucket;region=eu-west-1;...
See the Backup and Restore guide for full configuration options.
Limitations
- Only one backup can run at a time
- Primary and replica backups are separate (each has its own
backup_instance_name)
See also
- Backup and Restore guide - Complete backup configuration and restore procedures
- CHECKPOINT - Manual checkpoint mode for QuestDB OSS backups