I am new to MySQL and want to know the info whether taking a cold backup from source and copying it onto new server with same version require any additional configurations settings to be changed.

As I have gone through few of the tutorials, none of the config changes are required.

Steps I am following

  1. Shutting down source server
  2. copying the backup (/var/lib/mysql).
  3. importing backup to new server (/var/lib/mysql).
  4. Start the new server.

Thanks in advance


You missed three(3) things

  1. On DB1, mysql -uroot -ppassword -e"SET GLOBAL innodb_fast_shutdown = 0"
  2. On DB1, service mysql stop (DB1)
  3. Copying the backup (/var/lib/mysql) on DB1
  4. Copy /etc/my.cnf on DB1 to /etc folder on DB2
  5. Importing DB1 backup to DB2 (/var/lib/mysql)
  6. On DB2, chown -R mysql:mysql /var/lib/mysql
  7. Start mysql on DB2

Step 1 flushes everything InnoDB not yet committed to disk. That makes for a faster mysql startup.

From here, you have the option of changing settings

Give it a Try !!!

  • 2
    My understanding is that innodb_fast_shutdown=0 forces all purges and change buffer merges to finish before shutdown. But this doesn't save you any startup time, because startup doesn't require purging and merging to be complete. The default of innodb_fast_shutdown=1 should be fine, this still flushes the buffer pool so there won't be any crash recovery on startup. The only thing that would cost more time on startup is if you shut down with innodb_fast_shutdown=2, which skips flushing. Aug 15 '13 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.