This runbook details the steps to restore a MySQL database from a backup.
Prerequisites
- Access to the database server
- Database credentials
- Backup file available
Steps
- Login to the Database Server
ssh user@db-server
- Transfer the Backup File
scp user@backup-server:/path/to/backup/backup.tar.gz .
- Extract the Backup
tar xzf backup.tar.gz
- Restore the Database
mysql -u root -p database_name < backup.sql
- Verify the Restoration
mysql -u root -p -e "SHOW TABLES;" database_name
Verification
- Check that all tables and data are present in the database.
- Verify the application functionality that depends on the database.