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

  1. Login to the Database Server
ssh user@db-server
  1. Transfer the Backup File
scp user@backup-server:/path/to/backup/backup.tar.gz .
  1. Extract the Backup
tar xzf backup.tar.gz
  1. Restore the Database
mysql -u root -p database_name < backup.sql
  1. 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.