Move WordPress to DreamHost

From DreamHost

Jump to: navigation, search

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.

The Easy Way: As of WordPress 2.1, an export function is available under "Tools"; you'll find it under "Manage" earlier versions. This will let you export all of your posts, pages, comments and user accounts, though users will have to set new passwords.

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:

  1. From phpMyAdmin
  2. From cPanel (cPanel.net)
  3. 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 > MySQL Databases. 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 may be able to name your new DreamHost database exactly the same as your old database; and you may be able also to create the same username/password combination for the database, depending upon whether or not these names are already in use on our system, and if you can do this you'd therefore be able to avoid editing the wp_config.php file.

Test installation

I

When migrating MySQL from one host to another, it's possible to test the new installation before modifying your domain's DNS entries. To do this, make a "mirror" of your DreamHost-hosted domain, by adding "yourdomainname.dreamhosters.com" as a mirrored subdomain. To do this, navigate to DreamHost Web Panel > Domains > Manage Domains, click the "Add New Domain / Sub-domain" button, and scroll down to the "Mirrored" section. Enter the new domain name in the "Domain that mirrors:" text field, and select the domain you want to mirror in the drop-down. Make sure to leave ".com", ".org", or ".net" out of your subdomain name: e.g. if your domain is "yourdomain.net", the new subdomain should be "yourdomain.dreamhosters.com". Then click the "Mirror with this subdomain now!" button. Once your mirror has been activated, you'll want to make sure you have a MySQL host name setup on it. You'll need to manually create the MySQL host name for your new mirrored sub-domain in the Goodies > Manage MySQL section of your web panel. The new MySQL host should be named in this format: mysql.yourdomain.dreamhosters.com. Then after that host name is setup, navigate to the mirror's phpMyAdmin interface, which should be located at yoursqlhostname.yourdomain.dreamhosters.com. Make sure to log in with the sql user login information you used to set up the database, not your DreamHost login information. Once you've logged into the phpMyAdmin interface, select the appropriate database, then "browse" the tables and edit their values to replace instances of "yourdomain.net" with "yourdomain.dreamhosters.com". When this is completed, you can then view your site at yourdomain.dreamhosters.com as installed. Once you've successfully confirmed and configured the installation, edit the appropriate SQL values back to "yourdomain.net"; you may then update your domain's DNS entries.

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.

External Links

Personal tools