patternsqlMinor
Moving MySQL Cold Backup to Another DB Server
Viewed 0 times
coldmysqlmovinganotherserverbackup
Problem
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
Thanks in advance
As I have gone through few of the tutorials, none of the config changes are required.
Steps I am following
- Shutting down source server
- copying the backup (
/var/lib/mysql).
- importing backup to new server (
/var/lib/mysql).
- Start the new server.
Thanks in advance
Solution
You missed three(3) things
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 !!!
- On DB1,
mysql -uroot -ppassword -e"SET GLOBAL innodb_fast_shutdown = 0"
- On DB1,
service mysql stop(DB1)
- Copying the backup (
/var/lib/mysql) on DB1
- Copy
/etc/my.cnfon DB1 to/etcfolder on DB2
- Importing DB1 backup to DB2 (
/var/lib/mysql)
- On DB2,
chown -R mysql:mysql /var/lib/mysql
- 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 !!!
Context
StackExchange Database Administrators Q#48198, answer score: 6
Revisions (0)
No revisions yet.