Phase 4 — Backup & Restore Multi-DB Support #109
Labels
No labels
architecture
backend
bug
ci
config
database
docker
documentation
duplicate
enhancement
frontend
help wanted
invalid
issue-25
issue-26
issue-42
issue-65
issue-67
issue-82
migrations
p0-critical
p1-high
p2-medium
p3-low
performance
quality
question
security
state-management
testing
timezone
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
fastie81/honbu-manager#109
Loading…
Add table
Add a link
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?
Issue: Phase 4 — Backup & Restore Multi-DB Support
Type: Refactoring / Feature
Priority: High
Epic: Epic: Database-per-Club Multi-Tenancy Split & Data Migration
Status: Backlog
1. Context & Purpose
The backup manager currently performs a single
pg_dumpof the monolithic database. When data is split across a Central database and multiple Club databases, the backup service must be modified to export/import multiple databases to guarantee full system recovery.2. Technical Specification
2.1. System Backup Refactoring (
backup_service.py)Modify
create_system_backup()in app/core/orchestration/backup_service.py:pg_dumpon the Central database using the primary connection credentials → export tocentral.dump.clubstable for all clubs with adatabase_name(e.g.honbu_club_<id>).pg_dumpcommand → export toclub_<id>.dump.central.dumpand allclub_*.dumpfiles) along with member photographs and club logos into a single system backup zip file..dumpfiles.2.2. System Restore Refactoring (
backup_service.py)Modify
restore_system_backup(zip_filepath):pg_restoreoncentral.dumpto populate the Central database schema and configuration.club_*.dumpin the temporary folder.DROP DATABASE IF EXISTS honbu_club_<id>andCREATE DATABASE honbu_club_<id>.pg_restorewith the targetclub_<id>.dumpfile to populate the schema and data for each club.2.3. Club-level Backup Refactoring
Modify
create_club_backup(club_id):honbu_club_<club_id>).pg_dumptargeting only that specific club database.2.4. Profile Photos Upload and Persistence Verification (Issue #90)
app/core/operations/member_ops.pyand repository integrations to guarantee write persistence before backup routines execute.3. Verification Plan
3.1. Automated Unit Tests
Write tests in
tests/unit/test_backup_split.py:subprocess.Popen/subprocess.check_call).create_system_backupexecutespg_dumpexactly1 + Ntimes (whereNis the number of active clubs).restore_system_backupexecutes database creation and restore commands for each backup file.3.2. Manual Verification
central.dumpand files likeclub_1.dumpexist inside.Part of Epic #105