This runbook describes the process to back up a MySQL database.

Prerequisites

  • Access to the database server
  • Database credentials

Steps

  1. Login to the Database Server
ssh user@db-server
  1. Dump the Database
mysqldump -u root -p database_name > backup.sql
  1. Compress the Backup
tar czf backup.tar.gz backup.sql
  1. Transfer the Backup to a Safe Location
scp backup.tar.gz user@backup-server:/path/to/backup/
  1. Remove Old Backups
find /path/to/backup/ -type f -mtime +30 -exec rm {} \;

Verification

  • Check the backup file size and integrity.
  • Verify the backup exists on the backup server.