Table of Contents

Backup & Restore

Automated Backups

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

  1. Stop the cron worker — disable the crontab entry or pause the worker to prevent writes during restore
  2. Take a final backup of the current (broken) state for investigation
  3. Restore the SQL dump:
mysql -h HOST -u USER -pPASSWORD DATABASE < backup_20260518_040000.sql
  1. Run the GDPR scrub if restoring to staging: php tools/gdpr_scrub.php
  2. Re-enable the cron worker
  3. Verify: load the admin dashboard and confirm the restore is clean

Restoring to Staging

After restoring a production database dump to staging:

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.