Schedule the lead-database backup and get a copy off the operator's machine #211
Labels
No Label
P0
P1
P2
P3
accessibility
backend
bug
content
data-integrity
enhancement
frontend
infra
integration
owner
owner-input
performance
phase-7
phase-8
release-blocker
security
seo
ui
ux
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Queue-North-Website#211
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
/app/db/queuenorth.dbis the only live copy of every lead and support request the site has ever taken. It lives in the Docker named volumeqn-website-dev_queuenorth-dbon nebula, and it took writes on 2026-08-18.What is true now. As of 2026-08-18 this is no longer "no backups at all":
scripts/backup.shworks. Its ENGINE block was rewritten for SQLite — better-sqlite3's online.backup()inside the running container, thenPRAGMA integrity_checkand a table count before anything is renamed into place.scripts/restore-check.shworks, and has been run against production: the dump was replayed from SQL into a scratch database — 2 tables, 3 rows, under one second.docs/OPERATIONS.mdcarries the date.What is still missing, and this is the whole issue:
$HOME/backups/queue-north-websiteon the operator's workstation.backup.shsays this itself on every run: a backup that only exists beside the database it came from does not survive the disk, the host or the account.What to do, in order. The order matters — a schedule writing to a destination that does not survive is the more comfortable half of the job and the less useful one.
backup.sh's tail, or wrap it, to copy there. Keep the verify-before-rename contract intact.RESTORE_MIN_ROWSabove 0 once the lead count is meaningful. It is 0 today, which means the check cannot yet catch a snapshot of an emptied volume — the one failure no structural check can see.restore-check.shon a schedule too, and update Last verified restore indocs/OPERATIONS.mdwhen you do.The trap. A backup job that runs nightly for a year and writes a file every night for a year, where the file is a snapshot of the wrong container or an empty volume, is indistinguishable from a working one by looking at the directory. The size column is plausible and the timestamps march forward. That is why step 4 is on this list and not optional.
Why P2 and not higher. The database holds three leads. The exposure is real and the loss today would be small; it grows every week this stays open.
Verify: a scheduled job produces a dated dump in a location that is neither nebula nor the operator's workstation,
bash scripts/restore-check.shpasses against the newest one, anddocs/OPERATIONS.md's Last verified restore row names a date from that schedule rather than a manual run.Evidence that the first half of this is already done, recorded here so the remaining scope is unambiguous.
scripts/backup.shandscripts/restore-check.shwere both run against production on 2026-08-18:So the scripts work and the dump is restorable.
docs/OPERATIONS.mdcarries Last verified restore: 2026-08-18.What is left is the part in the title: a schedule, and a copy off the operator's machine. Neither exists.