Backup and restore
What to back up, how often, and how to restore. Observal has three persistent stores with very different loss profiles.
What matters, in order
Critical
apidata
JWT signing keys
Every session invalidated. No recovery without the keys.
Critical
pgdata
Users, RBAC, registry metadata, agents
All accounts and registry lost.
Important
chdata
Session events, aggregates, audit, and security events
All telemetry lost. Accounts and registry survive.
Low
grafanadata
Custom Grafana dashboards
Custom dashboards lost; provisioned defaults come back automatically.
Low
redisdata
Job queue state
In-flight jobs lost; they re-queue on next worker restart.
Always back up apidata and pgdata together. Backing up one without the other leaves you in a broken state after restore.
Backup cadence
Daily
pgdata, apidata
30 days
Weekly
chdata
12 weeks
Before every upgrade
All three
Keep until the upgrade is confirmed stable
Postgres backup
Use pg_dump inside the running container:
docker compose -f docker/docker-compose.yml exec -T observal-db \
pg_dump -U postgres observal | gzip > observal-pg-$(date +%Y%m%d).sql.gzRestore into a fresh DB:
JWT key backup (apidata volume)
The API container mounts the apidata volume at /data and stores keys at /data/keys. Tar it out:
Restore:
ClickHouse backup
Option A - volume snapshot (simplest)
Downtime: however long the tar takes (a minute to tens of minutes depending on size).
Option B - ClickHouse native BACKUP (no downtime)
Requires configuring a backup disk in ClickHouse config; see ClickHouse docs.
Restore:
Restore order
If you're restoring from backup after a catastrophic failure:
Stop the whole stack:
docker compose down.Restore
apidata(JWT keys) first.Restore
pgdata(Postgres).Restore
chdata(ClickHouse).Bring up the stack:
docker compose up -d.Smoke test:
observal auth login,observal auth status.
Skipping step 2 works but every user has to re-login.
Verifying a backup
Test restores in a staging environment at least quarterly. Untested backups are guesses.
Smoke test after restore:
Automated backup
A minimal cron setup (on the Docker host):
Ship the /backups directory offsite (S3, B2, rsync to another host).
Next
Last updated
Was this helpful?