I’ve used an external hosting provider for several web-based projects since 2002. Having my own shared server space has vastly reduced the red tape that would be involved if I were attempting to host these projects within my institution’s network, and it’s given me a great deal of control over how my web projects operate. Julie’s written about the ins and outs of choosing and working with a hosting provider, noting the flexibility that such services can provide.
That’s the up side. There are down sides as well, most of which surface if you’ve selected a less-than-optimal provider. The good news is, however, that there are always other hosting fish in the internet sea, and you can move if the need presents itself.
Such a need presented itself to me at extremely short notice: back in spring 2004, the hosting provider I’d worked with for the previous two years informed me that they were shutting down in a matter of days, and that I needed to make arrangements PDQ. There wasn’t a lot of time, and I had not only to find a new hosting provider but also to make sure that I could export and migrate my existing websites more or less immediately.
It was a stressful few days, but the good news is that the latter part of this process has become much easier, thanks to developments in WordPress and in hosting provider control panels.
Step 1: Back Up Everything
This should go without saying, but before you begin you’ll want to be sure you’ve got a good, secure backup of everything you could potentially need. Download all of the WordPress files that currently exist on your server. Make sure to grab any invisible files from the server as well, such as .htaccess; these might not automatically download unless your FTP client is set to show them.
You’ll also need to download a copy of your WordPress database. There are a couple of different ways of going about this, including using the “export” tool within WordPress itself, but the best way to be certain that you’re getting the entirety of the database is to go straight to MySQL. Using your old hosting provider’s control panel, a database administrator like PHPMyAdmin, or the command line, create a database dump that includes all tables and save it to your hard drive.
Step 2: Tell the Internet Where You’re Going
Assuming that you intend to keep the domain name that you’re currently using, but simply host it from another server, you’ll need to let the domain name system know where your URL should now be found. Your new hosting provider will have information on the particulars of how to change your DNS entry within their system, but the main thing to know is that a DNS change can take 24 hours to propagate through the system, during which time visitors may erratically be sent to one server or the other, depending on where they are. So you may want to let people know that there might be a little weirdness for a day or two.
Step 3: Go There
Again assuming that you’re keeping the same URL as you had before, the first part of this stage is pretty simple: upload all of your files from your old server, in exactly the structure they were before.
Now, within your new hosting provider’s control panel or database administrator, create a new MySQL database. Ideally, you’ll want to use the same database name, username, and password that you had on the previous server.
Once the database has been created, import the data that you dumped out of your old database into the new one.
Step 4: Tell WordPress Where It’s Gone
Within the core WordPress files you downloaded in Step 1, find “wp-config.php”; this file contains all of the configuration information that allows WordPress to communicate with your database. If you were able to use the same database name, username, and password on the new service as you used on the old, those three entries should remain the same, but if you had to make any changes, reflect them here. You’ll also likely need to change the fourth entry in wp-config.php, the host; your service provider should provide information about the host server on which your database lives.
Step 5: Profit!
That’s pretty much it. Once the DNS change has propagated through the internet, your site should be live on the new server.
Of course, changing your URL within such a move makes it a much more complicated process; for this, you may want to consult WordPress.org’s support pages. And in any such move, you’ll want to be sure to consult the support documents at your hosting provider. But in any case, rest assured: this will be much easier than moving house!
[Image by Flickr user Skrewtape; / Creative Commons licensed]