Moving mysql files on servers

I have a massive MySQL database (about 10 GB) and I need to copy it over to another server (slicehost). I don't want to dump the database and reimport b / c. I think forever. Is it possible to just move raw SQL files from one computer to another, set up an identical mysql server, and flip the switch?

+2


a source to share


3 answers


It should work.



This is the principle that the mysqlhotcopy tool uses , although the tool is designed to run while the server is running.

0


a source


As a rule, yes. It is preferable to have the same base architecture and server version, but this is not critical. Make sure you stop the source server so that the source files are a consistent copy.



I do this all the time, overwriting my dev database. We have replica backups made from tarring /var/mysql

when the server is stopped. I transfer them to another machine, overwrite iblog

and ibdata

then overwrite all directories in data

except mysql

and test

.

+1


a source


You don't have a "massive" database, you have a small 10G database. So dump / restore shouldn't be a problem.

Copying files directly may work in several circumstances, but dump / restore is much better (i.e. less chance of problems).

It is clear to try first on a non-production system with the same mysql version (s) and data size to make sure it will work in production.

0


a source







All Articles