BACKUP keyword

BACKUP - start and abort incremental backups to object storage.

note

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:

ColumnTypeDescription
statusVARCHARaborted or not running
backup_idTIMESTAMPTimestamp of aborted backup, or NULL

Example when backup was running:

statusbackup_id
aborted2024-01-15T10:30:00.000000Z

Example when no backup was running:

statusbackup_id
not runningNULL

Monitoring backups

Use the backups() table function to monitor backup progress and history:

SELECT * FROM backups();

Returns:

ColumnTypeDescription
statusVARCHARCurrent status (see below)
progress_percentINTCompletion percentage (0-100)
start_tsTIMESTAMPWhen the backup started
end_tsTIMESTAMPWhen the backup completed (NULL if running)
backup_errorVARCHARError message if backup failed
cleanup_errorVARCHARError 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