Jump to content

Easy way to move 40 databases from one server to another?


ghurty

Recommended Posts

I am trying to move about 40 databases from one server to another. Is there an easy to use command that will allow me to do that?

 

The two servers are on separate private networks, so I may not be able to copy them directly, so what I would want to do is create a backup, then manually move it and the restore it.

 

I belive I need to exclude informatio_schema as well as the mysql databses.

 

Thanks

Usually you run mysqldump to create a database copy and backups as follows:

 

$ mysqldump -u user -p db-name > db-name.out

Copy db-name.out file using sftp/ssh to remote MySQL server:

$ scp db-name.out [email protected]:/backup

Restore database at remote server (login over ssh):

$ mysql -u user -p db-name < db-name.out

OR

$ mysql -u user -p 'password' db-name < db-name.out

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.