Skip to content
GitHub

Self-hostOperate

Backups

Holtkeeper keeps everything that matters in its database: forges, credentials, settings, analysis history, the audit log. Artifacts can be regenerated, caches are disposable, and the vault key is the one thing nobody can recreate. Back up the database and the key; the rest is optional.

What Back up Why
Postgres schema holtkeeper or the SQLite file yes Everything except artifacts. Credentials in it are sealed with the vault key.
Vault key and the other secrets yes, separately Without the vault key the sealed credentials in a backup cannot be read.
Artifact bucket or /data/artifacts optional Content-addressed; rerunning analyses regenerates them.
/workspace, /mise, the egress cache never Caches; rebuilt on demand.

A logical dump is a consistent snapshot of a running database:

Terminal
pg_dump --schema=holtkeeper --format=custom "$HOLTKEEPER_DATABASE_URL" > holtkeeper.dump
pg_restore --dbname "$HOLTKEEPER_DATABASE_URL" holtkeeper.dump

For point-in-time recovery, use your platform’s base backups and WAL archiving: a managed database’s backups, your operator’s (CloudNativePG and others), pgBackRest or barman.

Under Compose, run the dump in the postgres service:

Terminal
docker compose exec -T postgres pg_dump -U holtkeeper --schema=holtkeeper --format=custom holtkeeper > holtkeeper.dump

A plain copy of a live file can be torn. Use a consistent snapshot:

Terminal
sqlite3 /data/holtkeeper.db ".backup /data/backup.db"

VACUUM INTO 'backup.db' works too. If you copy files by hand, stop the container first, or copy holtkeeper.db, holtkeeper.db-wal and holtkeeper.db-shm together. To restore, put the backup at the configured path while the process is stopped.

Artifacts are reports, encoded image variants and cached results. They are content-addressed and regenerated by rerunning analyses, so backing them up is optional. If you want them, turn on versioning or replication on the bucket.

server.retention keeps the artifact store from growing without bound. The sweep runs hourly on the process holding the scheduler lease: first everything older than days, then, while the store is above maxBytes, the least recently used.

holtkeeper.config.ts
retention: { days: 90, maxBytes: 200_000_000_000 },

The starting configs keep 90 days. Settings › System › Storage and caches shows the retention in force, the bucket’s usage against the quota you declared, and the change over the last seven days. From there admins can also clear storage areas by hand.

The leader also sweeps the audit log by its own retention and checks the audit chain daily.

  1. Start from the same image version as the backup, or a newer one: migrations run forward only.
  2. Restore the database while no Holtkeeper process is running.
  3. Give every process the same HOLTKEEPER_VAULT_KEY as before.
  4. Start web, check /readyz, then start workers.
  5. If artifacts were not restored, rerun the analyses whose files you need.