Wednesday, December 4, 2013

Restore S3 backup to MySQL

In this blog post, we backed up our MySQL database: http://cloudconclave.blogspot.com/2013/12/backup-of-mysql-on-aws-to-local.html. Now we will restore this backup.

1. Assumes this directory has been created: /backup/restore. If it does not exist on the EC2 instance, issue this command: mkdir -p /backup/restore
2. aws s3 cp s3://sysopsmysqlbackup/backups/<BACKUP-FILE> /backup/restore/restore.sql --region us-west-2
Note: BACKUP-FILE is the name of the backup file in S3
3. mysql -u root -ppassw-lab awslabrestore < /backup/restore/restore.sql




No comments:

Post a Comment