Skip to content

Back up and restore a database

Your database is the irreplaceable half of your site (the other half is files). A code bug, a bad migration, or a hack can corrupt it in seconds — a good backup is what gets you back.

Take a dump (MySQL/MariaDB)

From the web terminal or SSH:

Terminal window
mysqldump -u YOURUSER -p YOURDB > myapp-$(date +%F).sql

Take a dump (PostgreSQL)

Terminal window
pg_dump -U YOURUSER -h 127.0.0.1 YOURDB > myapp-$(date +%F).sql

Restore

MySQL: mysql -u YOURUSER -p YOURDB < myapp-2026-01-01.sql PostgreSQL: psql -U YOURUSER -h 127.0.0.1 YOURDB < myapp-2026-01-01.sql

(For MySQL you can also use phpMyAdmin — see Import & export.)

Don’t stop at a manual dump

Manual dumps are great before a risky change, but your real safety net is automated, offsite backups. OrbixPanel’s backups (restic) snapshot your data encrypted to offsite storage on a schedule — set it up once and forget it:

Make sure your backup includes both the database and the site files — you need both to restore a working site.

The step everyone skips

Test a restore. Once a month, restore a dump into a scratch database and confirm the data’s all there:

Terminal window
mysql -u YOURUSER -p restore_test < myapp-latest.sql

A backup you’ve never restored is a guess.


Running OrbixPanel? Automated encrypted offsite backups are built in. OrbixPanel.com → — the free, self-hosted, AI-powered hosting control panel.