HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Physically migrate MySQL without a dump

Submitted by: @import:stackexchange-dba··
0
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 ?

Solution

Here is what you can do:

  • Old DB Server : 10.1.2.30



  • New DB Server : 10.1.2.40



STEP 01) On the Old Server, service mysql stop

STEP 02) On the Old Server, rsync -av --progress /var/lib/mysql root@10.1.2.40:/var/lib/mysql

STEP 03) On the New Server, chown -R mysql:mysql /var/lib/mysql

STEP 04) On the New Server, service mysql start

Make sure /var/lib/mysql on the New Server is on a much bigger disk mount

Context

StackExchange Database Administrators Q#36345, answer score: 9

Revisions (0)

No revisions yet.