This article describes how to migrate a WordPress installation between two domains hosted at DreamHost. The example domains used in these instructions are:
Step one – Back up your data
You should always backup your data before making any change to your site. View the following article for instructions on how to backup your web site files, database, and any email you wish to keep:
Step two – Add hosting for the new site
Add the new domain (newsite.example.com) to your new DreamHost account. Make sure to set it as Fully Hosted:
Step three – Create a new database on your new account
Navigate to the (Panel > ‘Goodies’ > ‘MySQL Databases’) page and create a new SQL hostname and empty database.
Step four – Transfer your WordPress installation
Transfer your WordPress files you’ve backed up in step one to your new DreamHost account. If you had email addresses on the old site (oldsite.example.com), make sure to create the same addresses on your new account. You can then transfer those emails.
- Import your web files using the following article:
- Import your database using the Migrate MySQL article:
- Transfer email from your old account:
Step five – Edit the new wp-config.php file
Update the following:
- Database name
- Database user
- Database user password
- Remove the existing WordPress table and modify wp-config.php with the imported $table_prefix value
Step six – Update the Home and Site url
In your panel, log into your database via phpMyAdmin.
Change the HOME and SITE url in the database to your new site name (newsite.example.com):
Step seven – Update all other urls in the database
WordPress hardcodes the site's domain name into the database in such things as image and link urls. This is a problem because when you click on a link on your new site, it redirects back to the old site. To change these, you can use a search and replace the plugin. Below are a couple of plugins that work:
Once the above steps are complete, the new site looks exactly the same as as it once appeared on your old domain name.