LifeMate — Personal, Family & Learning Companion
docs: add backup restore runbook
davoodmehraban89 committed
Oct 5, 2026 at 17:13 UTC
8dcb46e117eb9b9839eb2ee16894fd6ea9608125
1 file changed
+20
docs/operations/BACKUP_RESTORE.md
new
+20
@@ -0,0 +1,20 @@
1
+# Backup & Restore Runbook
2
+
3
+Use PostgreSQL-native custom-format backups. A backup is not considered reliable until a restore drill succeeds.
4
+
5
+## Backup
6
+Set `DATABASE_URL` through secret management, then run:
7
+
8
+`backend/scripts/backup.sh /secure/location/lifemate-YYYYMMDD.dump`
9
+
10
+The script uses `pg_dump --format=custom --no-owner --no-privileges`. Store backups encrypted with access limited to authorized operators and apply the retention policy approved for the deployment jurisdiction.
11
+
12
+## Restore drill
13
+Create an isolated empty PostgreSQL database. Point `DATABASE_URL` at that database and run:
14
+
15
+`backend/scripts/restore.sh /secure/location/lifemate-YYYYMMDD.dump`
16
+
17
+The restore uses `pg_restore --clean --if-exists --no-owner --no-privileges --exit-on-error`. Verify expected schema objects and representative rows. CI performs an ephemeral data round-trip on every change.
18
+
19
+## Production restore
20
+A production restore is destructive and requires explicit action-specific approval. Preserve the current database before replacement, record the selected recovery point, and verify authentication, family authorization and planner data after recovery.