Mysql – Best way to move apache and thesql setup to new server

apache-2.2MySQL

I just got my new server setup and in the corner and am in the process of moving services over to it from my existing box. I need to move over mysql and apache.

What's the best way to move everything over? Just copy over all the apache directory roots and the sites (the config files) I'm assuming is the best/only way to get apache over, but with mysql I obviously want to keep all the passwords for things, so should I just backup and restore or can I make them talk to each and tell the one server to just suck data from the other one?

EDIT: I can afford to take the site down for 30 minutes or so, if that makes a difference.

Best Answer

Learning to use mysqldump won't hurt and it will help you make backups of your databases and transfer them to another server too. Passwords and some other useful things live in database named mysql. A simple example:

mysqldump -u myuser -p mypassword mydatabase > dump.sql

Then just feed it to mysql anywhere else.

Related Topic