MySQL Backup and Restore from Command Line & migration between two servers


While migrating an application or website from one LAMP server in to another , major headache is the DB migration, here is how we can simplify things so that your local bandwidth will be untouched and time of migration will be minimum as this is a server to server communication. Here we are bypassing following steps which are normally in practice

1. Download backups to local machine

2. Extract

3. Upload to Remote Server

4. Restore Data separately

Backup Database

]# mysqldump database_name > database_name.sql

This will consume some time based on the size of database , which we are backing up.

Now copy this file from Local server to remote server.  Read this article to know how to do this., When this file get copied to the remote server, go to next step.

Restore Database

]# mysql –u username –p database_tobe_restored < backupfile.sql

This will prompt for password and upon submitting password there will be a cursor blinking with out any response text , and the time of wait is directly proportional to the size of file to be restored., wait until it finishes and check your restored database.

Previous articleWindows 8 WiFi disconnecting continuously : Trouble shooting, Solution
Next articleZip command in centos
abhilash, is a programmer by profession and a technology addict with a passion towards browsing , shopping and imaging . My views may be biased on reviews. all images and videos are copyrighted to respective owners.


Please enter your comment!
Please enter your name here