[Ops] Document restore procedure, add off-host backup copies, and back up the media volume #80
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
Scheduled database backups exist and work:
run_scheduled_backup(webapp/backend/app/tasks/reminder_tasks.py:1832) andmake backup-nowwrite pg_dump custom-format dumps to thebackupsDocker volume, with retention. But the backup story stops there:docs/OPERATIONS.mdcovers taking backups only.backupsvolume lives on the same host/disk aspostgres_data, so a single disk failure loses the database and every backup of it.mediavolume (uploaded lore/character images — permanent user data; declared atdocker-compose.yml:137, mounted rw into backend atdocker-compose.yml:48and ro into frontend atdocker-compose.yml:103) is not backed up at all.Current behavior
A dump nobody has ever restored is an untested backup; an operator facing a dead host today would have to improvise
pg_restoreflags, service ordering, and Alembic state under pressure — and would discover all uploaded media is simply gone.Fix / Spec
docs/OPERATIONS.md, end to end:pg_restoreof the custom-format dump into a fresh database (exact command incl.--clean/--createdecision, connecting as the app user vs postgres superuser).alembic currentmatchesalembic heads; app boots; a spot-check query.backupsvolume), and/or add an optional rclone push step torun_scheduled_backupgated entirely by env config (no-op when unset). Either is acceptable; document whichever is implemented.mediavolume in the backup story — either extend the scheduled backup task to tar the media directory alongside the dump (it is mounted at/app/mediain the backend container), or document a separate volume-backup step with the same retention/off-host treatment. Decide and implement one.audio_tempis transient scratch space and deliberately excluded from backups.Acceptance criteria
References
webapp/backend/app/tasks/reminder_tasks.py:1832(run_scheduled_backup)docker-compose.yml:48,docker-compose.yml:103,docker-compose.yml:137(media volume)docs/OPERATIONS.md(backup section)Filed from the July 2026 full-project review.