I’m moving a large wordpress mysql db (1.49gb) from an old server to a new one, what I did was to:
mysqldump -u root -p dbname > public_location/db.sql
then I did a:
wget http://oldserver/db.sql
I created the database on the new server, created the user, then:
mysqldump -u root -p dbname < db.sql
It says dump completed, but why is the database on the new server still empty? I don’t see any tables at all.
Rather than call
mysqldumpon the new server with the input file, just callmysqlYou can, if you are brave and the second VPS has port 3306 open to the old one via TCP and you have a user account
root@oldserverable to do the write, do this in one action:I wouldn’t attempt it over the Internet, but I’ve done it on a LAN several times.
Finally, don’t forget the
--routinesparameter if you have stored functions and procedures that need to migrate with the database. They won’t go into the dump without it.