AIFENG DCS · One-Click Backup & Restore Center

Full pg_dump + repo snapshot + config snapshot · versions never overwritten · keep latest 20 · restore drills prove backups work

🛡️ Safety pledge: every backup creates its own timestamped version folder and never overwrites older ones; all three backup pieces (full SQL dump + repo snapshot + config snapshot) carry SHA256 checksums; before any upgrade you can roll back to any historical version.

📁 1. Where are the backups?

All backups live in the repository backups/ folder. Each run creates its own timestamped folder (e.g. backup_20260722_153000) containing three pieces: staging_aifeng_dcs_staging.dump (the whole database), repo_snapshot.zip (all code and ledgers), config_snapshot.zip (config files), plus manifest.json recording each file's SHA256 fingerprint. The system keeps only the latest 20 versions live; older ones are packed into backups/_archive/ and never deleted. The boss can also double-click tmp/backup_now.ps1 to back up instantly.

♻️ 2. How do I restore?

Restore is a high-risk action and never runs automatically. The correct steps: ① pick a version in the backup list and click 'Restore' to file a Human-Gate request; ② the boss approves it in the Human-Gate ledger; ③ an admin runs locally: restore that version's .dump into the database with pg_restore, then unzip repo_snapshot.zip and config_snapshot.zip back into the repository; ④ after restoring, open this page and run a restore drill (create-verify-drop a scratch database) to confirm the data is intact. The system also runs periodic drills automatically to prove backups really can be restored.

🗓️ 3. How often should we back up?

Recommended: at least once a day (double-click tmp/backup_now.ps1 before leaving); always one manual backup before every system upgrade, optimization or bulk import; plus one extra at key business moments (month-end reconciliation, before big campaigns). Backups only write to the local backups/ folder and the local staging ledger — nothing is uploaded to the cloud or sent anywhere.