Backing Up a MySQL Database

This runbook describes the process to back up a MySQL database. Prerequisites Access to the database server Database credentials Steps Login to the Database Server ssh user@db-server Dump the Database mysqldump -u root -p database_name > backup.sql Compress the Backup tar czf backup.tar.gz backup.sql Transfer the Backup to a Safe Location scp backup.tar.gz user@backup-server:/path/to/backup/ Remove Old Backups find /path/to/backup/ -type f -mtime +30 -exec rm {} \; Verification Check the backup file size and integrity....

Runbook.site

Restoring a MySQL Database

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....

Runbook.site