gabriel / musehub public
feat BREAKING deploy infra/database-phase3-4-cleanup #1 / 1
AI Agent gabriel · 2 days ago · Sep 9, 2026 · Diff

feat(deploy): Phase 3-4 of DB migration -- retire manual backup as primary, restore RDS alarms

Phase 3: - Found and fixed a live bug: production's deploy/backup.sh cron still docker exec'd into musehub_postgres, which Phase 2 stopped. It had already silently produced an empty backup file that same morning. Rewrote to connect via DATABASE_URL (works against RDS or self-hosted Postgres identically) instead of exec'ing into a specific container. - Changed backup.sh's cron from daily to weekly on production -- RDS's own native daily backups + PITR now cover day-to-day recovery, so this is a secondary belt-and-suspenders backup, not the primary mechanism. Not added to staging (non-critical, RDS-native backups judged sufficient). - Removed the broken daily cron, installed the new weekly one, test-ran it live against RDS to confirm it works end-to-end.

Phase 4: - Restored a real AWS/RDS DatabaseConnections CloudWatch alarm for both environments (musehub-{env}-db-connections-high) -- #160 removed this believing it was inapplicable with no RDS anywhere; both environments genuinely run on RDS now. Ran cloudwatch-alerts.sh for real against both, verified both alarms live via describe-alarms. - Corrected Section 5's SPOF finding to be precise: RDS closes the no-managed-backups/patching gap but does not eliminate single-AZ SPOF -- both instances remain single-AZ, Multi-AZ is a real pending decision. - Updated pre-launch-checklist.md and Section 8's backup docs to match.

sha256:3404c581bd9905d4997ed46a04402586460f9a892da0b29fd9b23de6577e39c9 sha
+5 ~8 −3 symbols
6 changed · 1061 in snapshot files
sha256:fbe3f0bad866cb1b92c96fe1ca73569ee8204d564494221fbcfac0d41913cc93 snapshot
+5
symbols added
~8
symbols modified
−3
symbols removed
6
files changed
1061
files in snapshot
0
dead code introduced
Semantic Changes 16 symbols
+ docs/
+ src/
+ tests/
+ tools/
~ deploy/backup.sh .sh 1 symbol added, 1 symbol removed
DB_PASSWORD variable variable DB_PASSWORD L38–38
+ DATABASE_URL variable variable DATABASE_URL L53–53
~ deploy/cloudwatch-alerts.sh .sh 2 symbols added
+ RDS_INSTANCE_ID variable variable RDS_INSTANCE_ID L76–76
+ THRESHOLD_DB_CONNECTIONS variable variable THRESHOLD_DB_CONNECTIONS L37–37
~ docs/database-architecture.md .md 2 symbols added, 2 symbols removed, 2 symbols modified
Phase 3 — Retire the manual backup pipeline section Phase 3 — Retire the manual backup pipeline L181–191
Phase 4 — Documentation and ticket reconciliation section Phase 4 — Documentation and ticket reconciliation L191–202
+ Phase 3 — Retire the manual backup pipeline — DONE 2026-09-08 section Phase 3 — Retire the manual backup pipeline — DONE 2026-09-08 L181–202
+ Phase 4 — Documentation and ticket reconciliation — mostly DONE 2026-09-08 section Phase 4 — Documentation and ticket reconciliation — mostly DONE 2026-09-08 L202–225
Files Changed
~6
1061 in snapshot
← Older Oldest on infra/database-phase3-4-cleanup
All commits
Newer → Latest on infra/database-phase3-4-cleanup

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:3404c581bd9905d4997ed46a04402586460f9a892da0b29fd9b23de6577e39c9 --body "your comment"