Databases · about 2 min · 3 steps
Back up a MariaDB database
Saves one MariaDB database to a compressed backup file in /var/backups/shellbay/mariadb, readable by root only.
Runs on
- Debian / Ubuntu: supported
- RHEL / Fedora: supported
- Alpine: supported
Before you start
- Run the MariaDB (secured) workflow first.
What it changes on your server
- Writes <database>-<date>.sql.gz to /var/backups/shellbay/mariadb, which only root can read.
- Uses a consistent snapshot (--single-transaction), so InnoDB tables stay usable while it runs.
What Shellbay asks you
Which database?
Enter the name of the database to back up. List MariaDB databases shows the names. Make sure the disk has room for it.
- Database
- Text, up to 64 characters
Example:
wordpress
Steps
- Check the database
- Write the backup
- Check the backup is complete
Shellbay checks the server before the first step, and stops at the first step that fails.
When it's done
- The backup is in /var/backups/shellbay/mariadb. Copy it off the server too: a backup on the same disk doesn't survive losing the server.
- To restore: gunzip -c /var/backups/shellbay/mariadb/<file>.sql.gz | sudo mariadb (it recreates ‹database›).