Here’s a quick howto:
I use Rackspace as my cloud service; I was moving a few sites from one server using Ubuntu 10.04 LTS (Lucid Lynx) to a new one using 11.10 (Oneiric Ocelot). I hit a few issues, so I thought I’d tell you how to export a WordPress site in its entirety and move it between two LAMP servers.
- Open a file manager on your local machine, and open both remote locations.
- Copy the root and all files of the site to your new server in the same location.
- Copy the sites-available virtual host file from /etc/apache2/sites-available/ directory to the same location on your new server.
- Create the symbolic link in sites-enabled by changing into /etc/apache2/sites-enabled/ and using this command: “sudo ln -s /etc/apache2/sites-available/yourhostfile yourhostfile”.
- Open PHPMyAdmin for your old server in a browser window. Login, and open the database for the site you want to move.
- Go to the Export tab. Assuming you’re using UTF-8 encoding (and that’s a very safe bet), all you have to do is ensure that the Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT box is checked under Structure, and that all options are highlighted in the Export box. Export the uncompressed database and save to a convenient location.
- Open PHPMyAdmin in your new server, login, and create a new database with the same name as the one you’re importing.
- Import the database you exported.
- Create a user on that database with the same name and password.
- Edit the DNS zone file for your site to point to the new IP address for your new server.
- SSH into your server, and use this command: “sudo service apache2 restart”.
Hit Ctrl+F5 once you think the DNS records will have propagated, and ensure it worked.