Moving a WordPress Site to a New Host
Moving a WordPress site from one host to another is usually pretty straightforward, especially if you are keeping the same domain. I normally use BackupBuddy for this, because you put the import script and backup file into an empty directory and it takes care of almost everything else. (I believe you have to create your own empty database to import into, or at least, I’ve always done that part manually.)
In some cases, however, BackupBuddy is not an option. For those situations we have UpdraftPlus Premium and Migrate DB Pro. Both plugins require an existing install of WordPress, but they do a great job.
These days, most WordPress managed hosting companies offer free site migrations, which may be a better deal for your client than paying you to spend your time on it.
But there’s more to a migration than just moving your database and files. One big potential “gotcha” is email. Although many companies already use an external service like Google Apps (now GSuite), Microsoft Exchange Online, or Zoho, many more still use one company to host both their email and their websites. In this case, you have to deal with migrating the email from one server to another.
This can be done with IMAP accounts by using Outlook (or presumably another IMAP client, but I’ve only tried it with Outlook) as an intermediary. Connect to the old server using the domain name and the new server using the IP address, and copy the mail across. Read this tutorial from MediaTemple if you aren’t familiar with the process.
There are three things to watch out for when migrating email this way:
- You need all the logins and passwords for every email account
- It can be extremely time-consuming if there are many accounts or a lot of mail
- If the new host doesn’t allot as much mail storage as the old host, you’re going to have to archive the mail you can’t transfer.
If you move a WordPress site to a new host, the comments will still be part of that site. But sometimes the situation is more complicated than that. Vajrasar (whom I know from the GenesisWP Slack team) was faced with a situation where he had to migrate 3000 posts with 1500 comments into a new WordPress install where they would be broken out into different post types. He ended up using Disqus to migrate the comments and WP All Export / All Import for the actual content. Read the gory details on the Rockt.tech blog.
Importing an HTML Site to WordPress
I recently had a project where I needed to import an HTML site into WordPress, and because of certain things about the way the site was hosted and deployed, we weren’t able to use CMS2CMS the way we’d originally planned. (If you have to migrate a site from another CMS to WordPress, check these folks out. They may well be able to save you a lot of hair-tearing.) What I was able to do was make some modifications to the templates, generate a local version of the site, and use Stephanie Leary’s HTML Import 2 plugin. It took a few tries, though, and I had to use a two-step process in order to import categories and an even more convoluted process for guest authors. That adventure really deserves its own blog post, though. But I, too, can definitely recommend WP All Import/Export Pro, as well as the Post Type Switcher and Term Management Tools plugins.
If you’re just moving a site to a new host and keeping everything else the same, you don’t need to worry about these, but if you are changing domains or changing post types (which will in turn change permalinks) the way Vajrasar and I both did on our recent projects, you’ll need a lot of redirects. In some cases you can use regular expressions to reduce the list; in others, you’re just stuck writing a lot of redirects. Make sure you have a complete list of the old URLs before you dismantle the original site. There’s a batch rewrite generator where you can paste in your whole spreadsheet of old and new URLs and get either 301 redirects or .htaccess rewrite rules. I tend to steer clear of plugins like Redirection, but there may be times when that’s preferable. There’s also a redirect manager in Yoast SEO Premium. Read more about redirects on Yoast.com.
The TL;DR on Site Migrations
If you’re planning to move your website to a new hosting company, a new domain, or even a new CMS, take some time to make sure you have everything in place before you start. Even when a hosting company offers free migration of your website, they won’t necessarily handle your email migration, and you’ll need to take care of your DNS and your redirects yourself. Get all of your account passwords together, make a spreadsheet with your current site URLs, and list out every place you’ll need to update your domain (if you’re changing it), such as your social media profiles and email signature.