Move a database to another server

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Move a database to another server

Post 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? :)
ldougherty
Forum Contributor
Posts: 103
Joined: Sun May 03, 2009 11:39 am

Re: Move a database to another server

Post 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
Post Reply