Skip to content
quarry View Ticket
Login

View Ticket

Backups for the beta host: litestream for OLTP, nightly store copies, one verified restore

Closedd49b1bf22c8d772ce1a29260ec11cd83f9d6fb78Created 87.6 days agoUpdated 67.9 days ago
Description2026-09-04 09:15:28
The forge OLTP database (accounts, sessions, grants, landings state, CI runs) is the only non-derived state outside the stores. Wanted: litestream replication of oltp.db to a Hetzner Object Storage bucket, a nightly copy of every .zit store to the same bucket, and a documented restore that has been run once end to end before anyone is invited. Indexes are derived and rebuild from the stores; they are not backed up.
2026-09-04 13:29:35

Local half done on hetzner-big-eu: /srv/quarry/backup.sh takes SQLite online backups of oltp.db and notify.db, tars every store and the dagnats data, checksums the set, verifies the oltp copy against the live account count and an integrity check, and keeps 14 days under /srv/backups. /srv/quarry/restore-test.sh opens the latest backup's store with zit and its database with sqlite in a scratch directory; it runs after every backup. Both ran once: 17 MB, store opens at trunk 8856284830c4, restorable. Timer quarry-backup.timer at 03:17 UTC nightly. Offsite half waits on a Hetzner Object Storage bucket and its S3 keys in Doppler; litestream is installed for it.

2026-09-04 17:44:36

Offsite half done against the Cloudflare R2 bucket quarry-server (keys in Doppler quarry/prd): litestream replicates oltp.db and notify.db continuously to litestream/ with a week of retention, and the nightly set is copied by rclone to nightly// and pruned there after 14 days. Verified end to end: litestream restore from the bucket produced a database with the live account count and a clean integrity check, and the nightly restore test opens the backed-up store with zit. One trap recorded for the next person: the S3 endpoint must be the origin alone, not origin/bucket — with the bucket in the path every upload lands under a doubled key.