Move WordPress to DreamHost

From DreamHost
Jump to: navigation, search

Overview

The following covers the process of moving your WordPress site with your current host to DreamHost.

If you're moving from WordPress.com then you'll have to follow their official directions: Moving from .com to self-hosted WordPress

They also offer a Guided Transfer. Due to complications with the WordPress.com setup, if their official directions don't work properly, DreamHost strongly recommends you purchase the guided transfer.

Note2 icon.png Note: Before making any changes to your website, DreamHost highly recommends backing up your database. Instructions can be found on our wiki page:

But you may need to contact your current host for instructions on how to export in their system.


Migrating using the Duplicator plugin

Use the free Duplicator Plugin which packages up your WordPress install as well as the MySQL database on the "source" side.

Important icon.png Important: Using this plugin may cause you to hit memory limits on a shared server. For information on how to avoid these limits, please view the following articles:


The following steps walk you through the migration process.

  1. Install and open the Duplicator plugin.
    01 Duplicator create package.fw.png
  2. Click the Create New button.
    A page appears allowing you to name this backup and enter your database information:
    Move Wordpress Duplicator Name Backup.png
  3. On this page, name this backup anything you like.
    Move Wordpress Duplicator DB Fields.png
  4. Enter your current database credentials and name of the New URL you're going to copy this site into.
  5. On the bottom, click the Next button to proceed.
    The following screen appears:
    02 Duplicator Scan Complete.fw.png
  6. Click the Build button to create the backup.
    The download page appears.
    03 Duplicator Download.fw.png
  7. Click on both the Installer and Archive buttons to download the files.
    You will have downloaded a file named ‘installer.php’ and ‘backupname.zip’.
  8. Use our FTP wiki to upload the .zip and installer.php files to your new WordPress site.
  9. Go to to your MySQL Databases page at (Panel > ‘Goodies’ > ‘MySQL Databases).
  10. Create a new hostname and empty database for the site you’re migrating to.
  11. Once you create the database, visit the new URLs installer.php file. For example:
    
    newsite.dreamhosters.com/installer.php
    
    
    The following page appears.
    04 Duplicator Test new db.fw.png
  12. On this page, enter your new database credentials and then click the Run Deployment button.

The former WordPress site is now duplicated into the new site URL.

Notes

  • Your source and target systems need to have the ZipArchive PHP extension installed so that the Duplicator plugin can zip the package. You can check this by going to the System Compatibility page in the Duplicator plugin. On DreamHost, that means your site must be running PHP 5.3+. If your site isn't running at least php 5.3, you can easily change it if you edit the web hosting options of your domain from the (Panel > ‘Domains’ > Manage Domains’) page.
  • Depending on the file size of your WordPress site and database, the plugin may experience problems with importing your content to DreamHost. If the file size is too large, PHP may time out while attempting to restore the backup that the plugin creates. If this is the case, you can try to increase your php memory settings using a phprc file using the following wiki:

Migrating all of your files manually

You are also able to manually migrate the entire site. In order to manually migrate your data, you'll need to:

  1. Backup your database as a .sql file from your previous host.
  2. Backup your web files via FTP from your previous host.
  3. Create a MySQL hostname and database at DreamHost for the new installation.
  4. Upload these files via FTP/SFTP/SSH to your DreamHost server.
  5. Import your database to your DreamHost database server.
  6. Update your wp-config.php file to point to your DreamHost database.

Step one – Backing up your database

Before you do anything else, back up your MySQL database at your current host. The method of creating a backup differs from host to host. The simplest method is to use phpMyAdmin, a web-based SQL manager available in many hosts' panels.

For further information, check with your current host on how to back up your database as a .sql file.

Step two – Backing up your web files via FTP

At your current host, back up all your web files via FTP/SFTP/SHELL. Visit our FTP wiki which explains how to do this with DreamHost:

You may need to contact your current host to confirm what settings to use to connect to their server.

Lightbulb wiki.png Tip:
  • Archive and compress your old WordPress installation at the current host before you proceed for quicker results. Contact your current host for instructions on how to do this.
  • You can then upload the single file to your DreamHost server and log in via SSH to decompress it on our server. This is not necessary, but it may help to speed up the process.


Step three – Creating a hostname and database in your DreamHost panel

Once you have the backup files saved to your computer, make a new SQL hostname and a new, empty database for your WordPress installation in your DreamHost panel. You can create these on the (Panel > ‘Goodies’ > ‘MySQL Databases’) page.

05 Move WordPress create mysql.fw.png
Lightbulb wiki.png Tip: If you create the hostname and the database's name, user, and password information the same as your old hostname and database, you can avoid editing your wp_config.php file in step#5 below.


Step four – Transferring your WordPress installation

Transfer your WordPress files you’ve backed up to your new DreamHost account.

  1. Import your web files using our FTP wiki:
  2. Import your database using our Migrate_MySQL wiki:
Note2 icon.png Note: Assuming you created the database in your DreamHost panel with the same hostname, username, password and database name as was set up at your previous host, your site may already appear online. If not, proceed to step#5 below


Step five – Editing wp_config.php

It's likely that the hostname, database, username and password that you created in your DreamHost panel differs from the one on your previous host. If that's the case you'll need to update your wp-config.php file to make sure that the information matches the login credentials for your new database in the DreamHost panel.

Open the wp-config.php file and you’ll see the following contents:

06 Move WordPress wpconfig.fw.png
Note2 icon.png Note: Make sure that the table_prefix setting in wp-config.php matches your backup table prefix, otherwise WordPress will prompt you to install from scratch.


To confirm the table prefix, use phpMyAdmin to log into the database at DreamHost you’ve just imported in Step#4 above.

07 Move Wordpress database tables.fw.png
  • Once logged in, click your database name on the left. You'll see the tables appear underneath.
  • The first part of the table is the prefix. In the above example, the prefix is wp_92tnyu_.
  • Update your wp-config.php file's prefix field to match this table prefix.

Assuming your DNS is already pointed to DreamHost, your site will now resolve online. If your DNS is not pointed to DreamHost, view the section below on how to create a mirror site.

Testing your installation using a DreamHosters subdomain

Note2 icon.png Notes:
  • This step is only necessary if your DNS is still pointed to your old host and you wish to see your site at DreamHost before changing your DNS.


View the following wiki for full instructions on how to view your WordPress site at DreamHost before you point your DNS:

When this is completed, you can then view your site at your dreamhosters.com subdomain. Also note that some of your images/links may still be hard-coded to the original URL for your site. To change these, you can use a search and replace the plugin. Below are a couple of plugins that will work:

Update DNS records

When you're finally ready to host your site on our servers, you can point your DNS to DreamHost by either updating your nameservers, or by creating A records.

Updating your nameservers to point to DreamHost

After you verified that everything is working on your DreamHost account, you'll need to point your domain name to DreamHost's nameservers. Note that you don't need to transfer your domain registration to DreamHost – you only need to reconfigure its nameservers to point to DreamHost. In order to do this, access your registrar, or 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 nameserver settings to:

  • ns1.dreamhost.com 66.33.206.206
  • ns2.dreamhost.com 208.97.182.10
  • ns3.dreamhost.com 66.33.216.216

The change can take up to 3–72 hours to take effect, but often happens sooner than that.

Updating your A records to point to DreamHost

Alternatively, if you wish to keep your nameservers with your current DNS providerm you can set up DNS A records for the domain to point here to DreamHost. You will need to contact your current DNS provider to see how to set up A records on their end. You can view the DreamHost DNS zone records for your domain in your panel by going to (Panel > ‘Domains’ > ‘Manage Domains’).

  1. Click on the DNS link beneath the domain to view the DNS records.
  2. Use the IP address listed to the right of the www prefix for the domain.
  3. Create two A records at your current host using this IP:
    • one for the www record, and
    • one for the blank A record.

This way, your site will work with and without the www before the URL. Please note that the DNS A records will take several hours to update online after you’ve created them at your current host.

Checking for a successful installation

If you've done everything correctly, your domain will now resolve to 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 correct place.

Make sure that you on't make any edits 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.

The easiest way to access your site's files during the transition period is by entering your servername as the hostname in your FTP/SFTP/SSH program. You can view the correct server name on the (Panel > ‘Billing & Account’ > ‘Manage Account’) page. For example if your server is named flower, the hostname you’d enter into your FTP client would be flower.dreamhost.com.

See also