Move WordPress to DreamHost
From DreamHost
This article will inform you how to move a WordPress installation from one location to your DreamHost account. As these instructions are written by users, be aware that they may not match what you need to do exactly. Before doing anything that cannot be reversed, make sure to backup the WordPress database. See Backup MySQL for details on how to do this.
As of WordPress 2.1, an export function is available under "Manage". While it will export posts, comments, custom fields, and categories, it may not be perfect. This article assumes that you wish to have a perfect copy of your original installation.
Contents |
From your old host to DreamHost
Migrate your SQL database
See the Migrate MySQL article for detailed instructions for migrating your database. Note that for testing a WordPress installation with the yourdomain.dreamhosters.com domain alias, the specific SQL values you'll need to change are "siteurl" and "home" in the "wp_options" table.
Back up your database
Before you do anything else, back up your MySQL database. The method of creating a backup differs from host to host. The simplest method is to use phpMyAdmin, a web-based SQL manager available on many hosts' domain-management websites.
See the article Backup MySQL for instructions on three ways to make a SQL file containing your old database:
- From phpMyAdmin
- From cPanel (cPanel.net)
- From the shell via mysqldump
Create a destination hostname and database
Once you have a backup, make a new SQL hostname and a new, empty database for your WordPress installation, via DreamHost Web Panel > Goodies > Manage MySQL. If you make the hostname and the database's name, user, and password information the same as for your old hostname and database, you can avoid editing your wp_config.php file.
Transfer your WordPress installation
Next, you need to transfer your WordPress installation's files from your previous host to your new DreamHost account. You can do this either by downloading them to your computer first and then uploading them to DreamHost via FTP/SFTP or by logging onto your DreamHost account via SSH and pulling the files from your other server via FTP/SFTP directly to your DreamHost server. The second method can be much faster, especially if you have a big installation, so if you are even vaguely familiar with the Linux command prompt, you should pursue this option.
Regardless of what you end up doing, the whole process will be sped up significantly if you archive and compress your old WordPress installation prior to transferring it. To do this, you can log onto your old webhost's server via SSH, if they provide SSH access. If not, they might provide a tool via their panel that allows you to create a backup of your files on the server, which should allow you to download your entire directory (or directories, as the case may be) as a single .tar/.tar.gz/.zip file. The best method would be to then upload the single file to your DreamHost server and log on via SSH to decompress it on the server.
If executed correctly, this whole operation can be done in under 5 minutes.
Edit wp_config.php
After your database and WordPress files are transferred, make sure that the information in the wp_config.php file in your WordPress root directory matches the hostname and login information for your new database. Chances are that the new database that you set up on your DreamHost server will have a different name from the one on your previous host, as well as a different username/password. If you note this information from your previous host's control panel, you can name your new DreamHost database exactly the same as your old database; you can also create the same username/password combination for the database, and you'd therefore be able to avoid editing the wp_config.php file.
Test installation
It's possible to test the new installation before modifying your domain's DNS entries. To do this, use phpMyAdmin to replace instances of "yourdomain.net" with "yourdomain.dreamhosters.com" in your SQL database, and you can then view your site at yourdomain.dreamhosters.com. Once you've confirmed the installation, switch the SQL values back to "yourdomain.net", and you are then ready to update your domain's DNS record.
Update DNS records
Lastly, after you verified that everything is working on your DreamHost account, you'll have to point your domain name to DreamHost's name servers. Note that you don't need to transfer your domain to DreamHost, you only need to reconfigure its name servers to point to DreamHost. In order to do this, access your registrar, the service provider with whom you registered your domain. If you're not sure who you registered with, you can often find that information by going to Whois.net and entering your domain name in the search field. Access your registrar's control panel (it might be the same as your webhost, but doesn't have to be), and change your domain's name server settings to n1.DreamHost.com, ns2.DreamHost.com, and ns3.DreamHost.com. The change can take up to 48 hours to take effect, but often happens sooner.
Success
If you've done everything correctly, your domain will now bring up your WordPress installation on your DreamHost account. If you need to check if the domain is pointing to the right server, upload a text file to your domain's root directory on your DreamHost server (but not your old server) and try to access that file via a web browser. If it's there, that means your domain is now pointing to the right place!
Make sure that no edits take place on your WordPress installation during the 48 hour waiting period, since any changes that you make or any new content that you add will not carry over to your DreamHost account unless you retransfer the database as described above after your domain has transferred successfully. Also note that the easiest way to access your site's files during the transition period is by entering the your server's IP address as the hostname in your FTP/SSH program, making sure you note the correct IP address that is associated with each respective web hosting account.

