patternsqlMinor
Physically migrate MySQL without a dump
Viewed 0 times
dumpwithoutmigratemysqlphysically
Problem
A client ask me to migrate his MySQL DB:
The server doesn't have free space and it also has a very big table that is broken, so I can't dump it.
I can't REPAIR it because of lacking of free space.
Question : Is there a way to physically move MySQL DB data files to another server and use them for the "new" MySQL ?
The server doesn't have free space and it also has a very big table that is broken, so I can't dump it.
I can't REPAIR it because of lacking of free space.
Question : Is there a way to physically move MySQL DB data files to another server and use them for the "new" MySQL ?
Solution
Here is what you can do:
STEP 01) On the Old Server,
STEP 02) On the Old Server,
STEP 03) On the New Server,
STEP 04) On the New Server,
Make sure
- Old DB Server : 10.1.2.30
- New DB Server : 10.1.2.40
STEP 01) On the Old Server,
service mysql stopSTEP 02) On the Old Server,
rsync -av --progress /var/lib/mysql root@10.1.2.40:/var/lib/mysqlSTEP 03) On the New Server,
chown -R mysql:mysql /var/lib/mysqlSTEP 04) On the New Server,
service mysql startMake sure
/var/lib/mysql on the New Server is on a much bigger disk mountContext
StackExchange Database Administrators Q#36345, answer score: 9
Revisions (0)
No revisions yet.