3

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

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536
Nandan
  • 31
  • 1
  • 2

1 Answers1

6

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 !!!

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536