Skip to main content

Command Palette

Search for a command to run...

Restore InnoDB MySql from one AWS EC2 to another EC2

Published
1 min read
Restore InnoDB MySql from one AWS EC2 to another EC2
A

13+ Years of experienced as Full Stack Developer. Also worked as architect for building solutions and product to help for automation. Solution-oriented and hands-on technical utility player. Having experience of more than 4 years of experience in E commerce and finance in each domain. Experience in having driving business automation, marketing using technology. Strong follower of open source technology. Used PHP, Python, AWS and Angular as technology stack to build product

I am sharing this experience and recovery option because i faced this issue while one IT person destroy EC2 instance but luckily he forgot to delete volume used for EC2. I am able to restore required MySql Databases.

Here are the steps for restoring an InnoDB MySQL Database on Ubuntu 12.04:

  1. Shut down the mysql service (sudo service mysql stop)
  2. Copy the database folder that contains the .frm files to /var/lib/mysql/[DBNAME]. As far as I know, this folder must be the same name as the old database.
  3. Copy the ibdata1 file from your old server to /var/lib/mysql/ibdata1
  4. *THIS IS IMPORTANT. Make sure the permissions of the files are correct.I simply did sudo chmod -R 777 /var/lib/mysql.
    Note : This is not recommended if your server is a production server.
  5. Start the mysql service (sudo service mysql start)

More from this blog

I

InternetKatta | AWS | Programming | Learning | PHP | Angular

87 posts

Write & Share What We learn | Learning can't measure because it is learning