• May 26, 2013

Previous

Next

Moving Your WordPress Blog

June 29, 2010, 11:00 am

moving your WordPress blogI’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]

This entry was posted in Software and tagged . Bookmark the permalink.

9 Responses to Moving Your WordPress Blog

peril - June 29, 2010 at 12:25 pm

This is good info- though it makes moving WP seem easier than it is- especially if you’re switching domain names :SI’ve done a lot of this (side job) and I find a direct backup to be good- but just in case things go super wrong (hey it happens) creating a private blog on wordpress.com can save the day:1. Create a wordpress.com private* blog2. Import your current blog to it3. Move WP and hope all is well, but if not, go to 4 ;)4. Import your contect back from wordpress.com to the new site*You don’t want to muddy your search engine resultsIt’s easy to do (Import found under settings tab in andmin panel). Of course you don’t want to rely on this- but working in IT I can tell you from experiance that there’s no such thing as too many backup/safety nets when you’re dealing with moving databases and so on.There are also a few plugins designed to make moving WP easier. However, in my experiance those are flaky at best, I would really NOT recommend using one.

kfitz - June 29, 2010 at 12:36 pm

Actually, moving WordPress is exactly this easy, if you’re not changing domain names, as I noted above. And there’s definitely a reason I left out the plugins. :)

emmadw - June 30, 2010 at 7:34 am

The problem is, as peril’s noted, if you’re changing domains. I ended up having to use a tool to edit the database to correct all the URLs a few years ago. Love the idea of going via WordPress.com :) (Guess if you had access to both domains at the same time, you could cut out the WordPress.com step – however, I was in the situation of a server having become very corrupt & the University taking the opportunity to move all staff websites to a common URL base, not the random set we’d had before.

billso - June 30, 2010 at 3:27 pm

Using WordPress.com has many advantages, but if you want full control on your WP install, you need to host the WordPress software somewhere else. WordPress.com only offers a limited set of plugins and themes, but they’ll take care of backup, bandwidth and redundancy. It’s a great service if you are setting up a plain old blog. If you run your own WordPress install on a server, you can do almost anything you want… as long as you backup your data. :)For a comparison, see http://en.support.wordpress.com/com-vs-org/

jmeloni - June 30, 2010 at 4:16 pm

Echoing billso’s comments above re: WordPress.com vs self-hosted WordPress. Just so everyone’s clear, this post is very much about moving a WordPress blog that is self-hosted.

billso - June 30, 2010 at 5:31 pm

jmeloni, my response #4 was to comments #1 and #3.

jmeloni - June 30, 2010 at 5:51 pm

@billso yes, I know.

emmadw - July 1, 2010 at 9:01 am

Thanks for the point, Billso; I have to say I was thinking about moving from one selfhosted domain to another, but presumably the point you’re highlighting is that even in the temporary time it’s on WordPress.com you could lose things you’ve put on. (I’ve not tried the via wordpress.com – I had to do it [very!] manually between two different domains)

bobpaver - July 8, 2010 at 7:47 pm

Kathleen,I think you might have overstated the ease of moving a blog from one host to another.Here are a few terms and processes from your article that are not familiar to many Internet users.”hosting provider control panels”"Download all of the WordPress files that currently exist on your servergrab any invisible files from the server as well, such as .htaccess”"FTP client” (they might recognize this one)”download a copy of your WordPress database”"MySQL”"phyMyAdmin”"command line” (are we talking unix shell here?)”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.” (domain name, hosted from another server, inform the domain name system?)Your claim of “easy” also leaves out some prerequisite knowledge, like a fundamental understanding of how the blogs and the Internet work.By the way, I heard your presentation at the NITLE Summit and thought it was fantastic. I do like the work that you are doing.Bob

  • 1255 Twenty-Third St, N.W.
  • Washington, D.C. 20037
subscribe today

Get the insight you need for success in academe.