Restore InnoDB MySql from one AWS EC2 to another EC2

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:
- Shut down the mysql service (sudo service mysql stop)
- Copy the database folder that contains the
.frmfiles to/var/lib/mysql/[DBNAME]. As far as I know, this folder must be the same name as the old database. - Copy the
ibdata1file from your old server to/var/lib/mysql/ibdata1 - *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. - Start the mysql service (
sudo service mysql start)





