Page 1 of 1

Move a database to another server

Posted: Tue May 05, 2009 1:52 pm
by JKM
Hi there,

I'm thinking about making a backup of my sql db on another server. I was thinking about doing a cronjob once a day, but I'm wondering how I should export a scheme and import it to another database.

Edit: I haven't got ssh login to the server it should export from.

Anyone? :)

Re: Move a database to another server

Posted: Wed May 06, 2009 6:09 pm
by ldougherty
Hello,

Is there a reason you want to create it as a functional database on the other server rather than just creating and storing the dump file on the other server?

For example what I use on my own servers...

On the back up server I have a cron with this script..

Code: Select all

mysqldump -u<USER> -p<PASSWORD> -h<REMOTE_HOST> db_name > db_name_`date +\%b\%d\%$
This will create the dump file named db_name_current_date