Implement scheduled database backup with configurable destinations #26
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The database holds every dating decision, every piece of evidence, and the full audit
history — the entire product of the review work. The photo files are replaceable by
rescanning; the review history is not. There is currently no backup of any kind.
Scope
Scheduled database backup with configurable destinations, using the existing
JobType.backup.Implementation notes
VACUUM INTO, not a filesystem copy. Copying a WALdatabase while it is being written produces a corrupt backup that looks fine until it
is needed.
PRAGMA integrity_checkon theresult. An unverified backup is a guess.
ready for the S3 backend in v0.5.0.
backupjob type on the existing worker.rather than silent. A backup system that fails quietly is worse than none, because it
removes the motivation to have another.
backup. Restoration should be verifiable in a scratch environment.
the repo.
Done when
References
backend/app/models/models.py(JobType.backup)docs/circa-spec.mdPhase 2Depends on: #2 (worker runtime).
Amended by the audit of 2026-07-28 — the scope of this issue is wrong.
This issue states photo files are "replaceable by rescanning" and therefore backs up only the
database. The user has confirmed that assumption does not hold: the physical originals are being
kept, but they are inconvenient to access and continuing to degrade.
So rescanning is not a recovery plan — it is weeks of work that produces worse scans than the
ones being replaced.
Storage-tree backup, executable restore, and scheduled restore verification are now tracked in
#117. Keep this issue for the database backup mechanism; treat #117 as its required companion
rather than a nice-to-have.