If you have ssh access an easy way to transfer a large mysql db is with scp. Just create the db on the new server then shutdown the db completely (on both servers) then scp the whole lot in one go to the new server and then make sure the tables on the new server are owned by mysql (chown mysql:mysql /path/to/yourdb/*) and restart mysql there. It should all be working fine as long as you created the appropriate db accounts (grant) etc. I've used this method often to copy db's with many gigs of data.
Something like this would do it..
scp /path/to/mysql/yourdb/* username@newserver.com:/path/to/mysql/yourdb/
if 'username' does not have access to /path/to/db/yourdb/ then just scp to whatever directory it does have access to (/home/username/tempdb/ for example) and then do a local copy/move to the appropriate mysql directory.
Check the man for scp options (man scp), test it with non-essential files/directories first and of course always make sure you have a backup before doing anything!
You could also use rsync over ssh (rsync -a -e ssh /full/path/* user@newserver:/full/path/) which is handy but seems a bit slower than scp alone.
Oh and make sure you have enough disk space on the new server before copying or you will end up with a broken db there.
You could also do a local copy first, zip/gzip the files then scp to the new server and unzip.. depending on your needs it may or may not be faster.
|