1.2 KiB
1.2 KiB
Backup And Restore Runbook
M00 provides checks and templates only. Production backups must be enabled by the Ubuntu administrator after database credentials, upload paths and EMQX configuration are confirmed.
Backup Targets
- MySQL logical dump:
/opt/apps/backups/mysql - EMQX data export:
/opt/apps/backups/emqx - Uploaded files archive:
/opt/apps/backups/files - Manual manifests:
/opt/apps/backups/manual
Backup Check
/opt/apps/setup.sh --backup-status
Manual Commands
The commands below are examples for the production administrator. Do not store real credentials in Git.
mysqldump --single-transaction --routines --triggers --events qipai > /opt/apps/backups/mysql/qipai-YYYYmmddHHMMSS.sql
emqx ctl data export
tar -C /opt/apps -czf /opt/apps/backups/files/uploads-YYYYmmddHHMMSS.tgz uploads
Restore Outline
- Stop the backend process through PM2 after confirming a maintenance window.
- Verify the selected backup files and hashes.
- Restore MySQL into a staging database before production.
- Restore EMQX export and restart EMQX.
- Restore uploads into
/opt/apps/uploads. - Run API, admin, miniapp and MQTT smoke checks.
Automatic production restore is intentionally disabled in M00.