Today’s HostGator, HostMonster, and BlueHost hosting outage caused a mass of problems for geeks everywhere as angry friends, family, and clients emailed to say something like this:
“WHERE THE HELL IS MY WEBSITE!?”
So, I wanted to do something to help out those that were affected (my sites were down today too). Here are some quick and dirty steps on how to perform a DIY hosting switch:
I’m making the following assumptions:
- Your existing host uses cPanel. (DreamHost and BlueHost have customized versions of cPanel and some of these instructions may vary slightly).
- Your new host will use cPanel.
- Your domain name is not changing.
Note: HostGator, BlueHost, and HostMonster among many, many others are owned by ONE company. If you want to avoid a host owned by that same company, check out this list to see if your next host is owned by those same folks.
Option 1: If you have $40 to drop, you can purchase WP Migrate DB Pro. The process is relatively simple if you know how to install WordPress and don’t run into any snags with permissions. This works when you have a small number of sites to transfer and your new host doesn’t have upload limits.
Option 2: If you want to give it a go yourself, here’s how (if my assumptions are correct):
Estimated time to complete: 30 minutes to 120 minutes depending on how big your site is and how tech savvy you are.
- Pick your NEW host. My suggestion is one of the following (none of these are Affiliate links): Liquid Web, Rackspace, or WestHost. Both Liquid Web and WestHost use cPanel, which will make the following steps easier if you’re not a techie.
- Log in to your OLD cPanel. Go to phpMyAdmin and find your WordPress database in the left-sidebar. If you have more than one WordPress installation, you can find the right one by clicking on the first database on the left-hand side, then clicking on the wp_options table. In the main screen, you’ll see a data grid. One of the fields will say, “siteurl” and that will be the URL this database belongs to.
- Snag a download of your database. To do this, click on the correct database (make sure you don’t have a table selected), then click the “export” button along the top-menu in phpMyAdmin. The default settings are all OK. You’ll get a .sql (which is a fancy text file) downloaded. Keep this somewhere safe for now.
- Download your wp-content folder. If you have the latest version of WordPress, this is really all you’ll need. If you are running an older version of WordPress (anything older than 3.7), copy everything. And, for the love of all that’s holy, upgrade your freaking site. Once you have it locally, you can delete wp-config.php. You won’t need it – you’ll actually want the new site to be created with a fresh version (so the database connections can be made).
- Install WordPress at your NEW host. You can do this either by using the one-click install (which, surprisingly, usually offers the most secure installation) or by doing it manually – creating a new database, then uploading a fresh copy of WordPress (or the one that matches the version you’re using on your OLD host – as in all your files).
- Use FTP to replace the NEW host copy of wp-content with the OLD one you downloaded in step 4. This uploads all your uploads, images, plugins, and theme files.
- Go to the NEW cPanel phpMyAdmin and drop tables on the new WordPress database. It’s a fresh install, so dropping tables sounds scary, but there’s no problem in doing it. Then, go to import and upload your SQL file you downloaded in step 3.
- Log in to your site and go to Settings -> Permalinks. Select whatever setting you want and hit “save”. This re-establishes your .htaccess file (how your permalinks are created).
- High-five yourself on a job well-done.
If you struggle with these steps, feel free to ask additional questions in the comments! Good luck!
(Photo credit: Chris Harrison)