Rollback Demonstration
Complete rollback capability including documented method, backup/restore methodology, and migration safety protocol.
Full MariaDB dump + file system backup using bench CLI. Backups are compressed (gzip) and checksummed (SHA-256) for integrity verification.
Estimated rollback time: 15-30 minutes depending on database size. Tested on staging with full dataset. RTO target: under 1 hour.
Pre-migration backup is mandatory. No migration proceeds without verified backup. Staging environment tested first. Production migration during maintenance window only.
Interactive Rollback Simulation
Full database and files backup before any migration begins
$ bench --site erp.shangu.co.za backup --with-filesValidate backup file checksums and test restore on staging
$ bench --site erp.shangu.co.za verify-backup --backup-path ./backups/latestGracefully stop web server and background workers
$ sudo supervisorctl stop allRestore MariaDB database from pre-migration backup
$ bench --site erp.shangu.co.za restore ./backups/pre-migration.sql.gzRestore uploaded files and private files from backup
$ bench --site erp.shangu.co.za restore --with-files ./backups/files.tar.gzClear Redis cache and rebuild search index
$ bench --site erp.shangu.co.za clear-cache && bench --site erp.shangu.co.za clear-website-cacheEnsure database schema matches the pre-migration state
$ bench --site erp.shangu.co.za migrateStart all services and verify system health
$ sudo supervisorctl start all && bench --site erp.shangu.co.za doctorRun reconciliation queries to confirm data matches pre-migration state
$ bench --site erp.shangu.co.za execute shangu_erp.utils.verify_rollbackMigration Safety Protocol
Pre-Migration Checklist
Rollback Triggers
Backup & Restore Methodology
# ═══════════════════════════════════════════════════════ # SHANGU GROUP - Migration Backup & Restore Procedure # ═══════════════════════════════════════════════════════ # 1. PRE-MIGRATION BACKUP bench --site erp.shangu.co.za backup --with-files # Output: Database SQL dump + files tarball in ./sites/erp.shangu.co.za/private/backups/ # 2. VERIFY BACKUP INTEGRITY sha256sum ./backups/*.sql.gz > ./backups/checksums.txt bench --site staging.shangu.co.za restore ./backups/latest.sql.gz --with-files # Verify staging site loads correctly # 3. MIGRATION EXECUTION bench --site erp.shangu.co.za execute shangu_erp.migration.run_full_migration # Monitor: bench --site erp.shangu.co.za execute shangu_erp.migration.get_status # 4. POST-MIGRATION VERIFICATION bench --site erp.shangu.co.za execute shangu_erp.reconciliation.run_all_checks # If any check fails → trigger rollback # 5. ROLLBACK (if needed) sudo supervisorctl stop all bench --site erp.shangu.co.za restore ./backups/pre-migration.sql.gz --with-files bench --site erp.shangu.co.za clear-cache bench --site erp.shangu.co.za migrate sudo supervisorctl start all bench --site erp.shangu.co.za execute shangu_erp.utils.verify_rollback # 6. POST-ROLLBACK VERIFICATION # Confirm all data matches pre-migration state # Confirm all business processes operational