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

Link to comment
Share on other sites

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 user@remote.box.com:/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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.