Skip to content

Backups and Recovery

gptBuster is distributed as a Docker image that requires a persistent storage volume for database data. You have two options for backing up this volume:

  1. Standard volume backup tools – Take a snapshot of the entire persistent volume.
  2. Built-in database backup – Upload database snapshots to AWS S3 or Azure Blob Storage.

Standard Volume Backup Tools

The backup process depends on your deployment runtime. Follow official Docker documentation or use third-party solutions to back up your volumes.

Recommended solution:

Azure App Services

When hosting on Azure App Services, the persistent volume is mounted using Azure Storage. For data protection, configure your storage with appropriate redundancy.

About Redundancy:

  • Protects against hardware failures, network/power outages, and regional disasters.
  • Does not protect against accidental deletion or human error.

Recommendation:

Enable automated database snapshots (as described in the Built-in Database Snapshots section) for additional backup protection.

Built-in Database Snapshots

The built-in backup mechanism lets you schedule automatic snapshots and upload them to remote storage (AWS S3 or Azure Blob Storage).

Manual Backups via the Admin App

  1. Navigate to Admin → Snapshots.
  2. Click Create Snapshot.
  3. Select the database to back up:
    • Main database – Contains primary data (users, API keys, etc.).
    • Redis – Contains short-lived data (rate limiters, etc.).
  4. Click Create to generate and upload the snapshot.

Configuring Automated Snapshots

Set these environment variables to enable scheduled backups:

VariableDescription
SNAPHOSTS_CRON_SCHEDULECron expression for backup frequency (e.g., 0 0 * * * for daily at midnight).
SNAPHOSTS_STORAGE_PROVIDERSupported: s3, azure, or local.
SNAPHOSTS_STORAGE_*Provider-specific credentials (e.g., SNAPHOSTS_STORAGE_AZURE_CONNECTION_STRING).
SNAPHOSTS_DB_PREFIX(Optional) Remote storage path prefix for snapshots (defaults to altcha-sentinel-backups/db/${iso_date()}).
SNAPSHOTS_ENCRYPTION_KEY(Optional) Encryption key for snapshots.

Refer to the Storage Providers documentation for more details.

Example (Azure Blob Storage):

SNAPHOSTS_CRON_SCHEDULE="0 0 * * *"
SNAPHOSTS_STORAGE_PROVIDER=azure
SNAPHOSTS_STORAGE_AZURE_CONTAINER=backups
SNAPHOSTS_STORAGE_AZURE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=test;AccountKey=XXXX;EndpointSuffix=core.windows.net

Restoring a Snapshot

Via the Admin App:

  1. Go to Admin → Snapshots.
  2. Click Restore Snapshot.
  3. Enter the remote snapshot URI (e.g., /altcha-sentinel-backups/db/...).
  4. Click Restore – the server will reload after restoration.

Via API:

Use these endpoints for programmatic backup/restore:

  • Create: POST /v1/admin/snapshots/create
  • Restore: POST /v1/admin/snapshots/restore

For details, see the API Documentation.