Scheduled daily DB backup and a tested restore procedure #57

Closed
opened 2026-07-15 15:38:30 +00:00 by claude-bot · 1 comment
Contributor

From the 2026-07-15 review follow-ups. Backups currently run only before bulk operations (yearly generation, bulk approve, import, sync). Ordinary-day corruption or a bad manual edit is unprotected, and the restore path has never been exercised.

  • Daily backup job in the scheduler (quiet hour, e.g. 04:00), reusing services/backup.py and the existing BACKUP_RETAIN_COUNT pruning — consider a separate retention knob for dailies vs pre-bulk-op backups
  • Use SQLite's online backup API (or VACUUM INTO) rather than a file copy while the app is live, to avoid copying a mid-write DB
  • Document the restore procedure in docs/setup.md or docs/troubleshooting.md (stop container → replace data/iris.db → start; note the alembic version expectations)
  • Actually test a restore once and note the result in this issue
  • Related: #18 (off-site target) builds on this

Acceptance: a fresh backup exists every morning; a documented restore has been performed successfully at least once.

From the 2026-07-15 review follow-ups. Backups currently run only before *bulk* operations (yearly generation, bulk approve, import, sync). Ordinary-day corruption or a bad manual edit is unprotected, and the restore path has never been exercised. - [ ] Daily backup job in the scheduler (quiet hour, e.g. 04:00), reusing `services/backup.py` and the existing `BACKUP_RETAIN_COUNT` pruning — consider a separate retention knob for dailies vs pre-bulk-op backups - [ ] Use SQLite's online backup API (or `VACUUM INTO`) rather than a file copy while the app is live, to avoid copying a mid-write DB - [ ] Document the restore procedure in docs/setup.md or docs/troubleshooting.md (stop container → replace `data/iris.db` → start; note the alembic version expectations) - [ ] Actually test a restore once and note the result in this issue - [ ] Related: #18 (off-site target) builds on this Acceptance: a fresh backup exists every morning; a documented restore has been performed successfully at least once.
claude-bot added this to the v1.0.0 milestone 2026-07-15 15:38:30 +00:00
Author
Contributor

Picking this up on fix/57-daily-backup off main (scheduler chain, after #59/#9 which are merged). Will switch backup to SQLite's online-backup/VACUUM INTO (safe while live) as the issue asks — bonus, that should also fix the Windows-only test_backup.py file-lock flake.

Picking this up on `fix/57-daily-backup` off main (scheduler chain, after #59/#9 which are merged). Will switch backup to SQLite's online-backup/`VACUUM INTO` (safe while live) as the issue asks — bonus, that should also fix the Windows-only `test_backup.py` file-lock flake.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Iris-WLED#57
No description provided.