Backup & Restore
Automated Backups
Offsite database backup runs daily at 04:00 via cron/jobs/backup_offserver.php
Softaculous backup runs daily at 02:00 via the hosting control panel — backs up files and database
healthcheck.io monitors both jobs — if either fails to check in, an alert is sent to the administrator
Manual Database Backup
mysqldump -h HOST -u USER -pPASSWORD DATABASE > backup_$(date +%Y%m%d_%H%M%S).sql
Take a manual backup before any database migration.
Restore Procedure
Stop the cron worker — disable the crontab entry or pause the worker to prevent writes during restore
Take a final backup of the current (broken) state for investigation
Restore the SQL dump:
mysql -h HOST -u USER -pPASSWORD DATABASE < backup_20260518_040000.sql
Run the GDPR scrub if restoring to staging: php tools/gdpr_scrub.php
Re-enable the cron worker
Verify: load the admin dashboard and confirm the restore is clean
Restoring to Staging
After restoring a production database dump to staging:
Always run the GDPR scrub first: php tools/gdpr_scrub.php — replaces personal data fields with anonymised values
Update lib/const/env.php on staging to point at the staging database (not production)
Do not run CronSchedule INSERT migrations on staging — staging has no cron daemon
File Backup
User-uploaded files are stored in the uploads/ directory. Back up this directory alongside the database. For a full platform restore, both the database and uploads must be restored together.