Technosailor
  • Home
  • Blog
  • Venture Files
  • Espanol
  • Technosailor Staff
  • Twitter Pitch Me!
Apr
06
2007

WordPress FAQ: How do I Move my blog to a new host?

Posted by: Aaron Brazell

What is the process for moving my WordPress blog to another host?

As the technology manager at b5media, my team is often asked to migrate a blog to our cluster. Usually, when that happens, I ask a bunch of relevant questions:

  1. Is the blog a WordPress blog? If not, what platform is it?
  2. Are we going to continue to use the same domain or do we want to use a new or existing one?
  3. Are we merging this blog with an existing blog?
  4. Is it important to preserve permalinks?
  5. If this is a WordPress blog, what version of WordPress is being used?
  6. How many authors?

Lots of relevant information is needed to migrate a blog. This question is about moving a WordPress blog so we’ll assume that it’s not a Movable Type, Typepad, Blogger or Expression engine blog. Or any other platform for that matter. WordPress.com counts as a “WordPress” blog though. ;-)

Solution 1: Quick Move

The easiest way to move from one blog to another, particularly if you’re moving the blog to a new domain and both already resolve (talk to your registrar or host to get help with DNS resolution) then you can move your categories, posts and comments using WordPress’ export functionality. This is native in WP 2.1, however, you can achieve nearly the same thing with my WordPress-to-WordPress importer. Having the WXR file, as it is called, in hand you can import into WordPress 2.1 at the new location.

The sacrifice you give up in preservation of options. You’ll have to go in and set your permalink structure, your blog name, description, number of posts to display and any other options. You will have to upload and activate plugins, etc. This is a content migration solution only.

Incidentally, this is the only way to move off of WordPress.com and the only way to merge a blog into another one - say if you were retiring it.

Solution 2: Full Move

If the quick way doesn’t provide satisfactory results, you can do the full way. I always recommend doing whatever you can by SSH, but some hosts won’t allow for that and some folks are simply scared stupid of command line. Is text really that scary? :)

1. First of all, back up your database. You can do this via phpMyAdmin. I would not recommend the formerly-bundled wp-db-backup plugin for a number of reasons that ultimately end in the reason why it is no longer a bundled plugin. If you’re using SSH, you’ll want to use the mysqldump command:

mysqldump -uUSER -p DBNAME > dump.sql

2. Now, grab your files. Most people choose FTP for this, but again, if you can use SSH to create an archive file of your data, do it for reliability reasons. Make sure you grab your .htaccess and database dump as well.

tar cvf archive.tar path/to/blog/dir path/to/dump.sql

The compress it:

gzip archive.tar

This will create a file called archive.tar.gz that you can grab via SFTP or FTP and transfer to your new server.

3. On the new server, you have to restore everything back in to place. First, make sure you have a database setup for your blog on your new server. If you just used FTP to grab all your stuff, ignore the next bit. If you tarred your archive and database dump, I’d recommend untarring in a temporary location.

tar zxvf archive.tar.gz

Now, whether you used FTP or SSH, you can move your data files into the proper location and run a:

mysql -uUSER -p NEWDBNAME < dump.sql

With any luck, once your DNS is pointed at the new server and begins to resolve, your blog will be perfectly moved.

Table of contents for WordPress FAQ

  1. WordPress FAQ: How Do I combine Blogs?
  2. WordPress FAQ: What’s up with the Amazon Plugin with WP 2.1.x?
  3. WordPress FAQ: How Do I Use Category Themes?
  4. WordPress FAQ: Where did my Preview Link Go?
  5. WordPress FAQ: How Do I Use Child Pages More Effectively?
  6. WordPress FAQ: How Do I Fix the Blogroll Category Issue in WordPress 2.1
  7. WordPress FAQ: How do I Move my blog to a new host?
  8. WordPress FAQ: User Roles Confusion
  9. WordPress FAQ: What is the best way to upgrade a WordPress 1.5 blog to WordPress 2.1?
  10. WordPress FAQ: Democracy Poll Feature
  11. WordPress FAQ: Benefits of Tagging
  12. WordPress FAQ: What’s the Best Way to Backup my Blog?
  13. WordPress FAQ: How Do I Integrate WordPress Into a Non-Blog Site?
  14. WordPress FAQ: Troubleshooting a WordPress Install
Previous in series Next in series
  • Add to Mixx!
  • Stumble it!
About the Author: Aaron Brazell is the lead editor of Technosailor.com and a social media expert. His passion is to see companies and individuals use the internet and web technologies wisely and effectively to promote their brands and companies. He served as Director of Technology at b5media from 2005-2008 and is currently an independent consultant.
Tagged: at 12:54 pm -

7 Responses to “WordPress FAQ: How do I Move my blog to a new host?”

  1. 1
    Michael Says:

    I have a big database (11M), I can’t import it via phpmyadmin since the max size allowed is 8M. I’d like to know in this case, is there a database size limit when importing the database with command line?

    April 6th, 2007 at 5:33 pm
  2. 2
    Aaron Brazell Says:

    There is no limit from the command line and, in fact, for people like yourselves that have large databases this is the way I recommend going. In fact, at this size, I’d try to make sure you do everything from the command line.

    April 6th, 2007 at 5:47 pm
  3. 3
    Douglas Karr Says:

    Michael and Aaron, if your host allows you to access your server, you can simply copy your /var/lib/mysql/ subdirectories local and then copy them to the new host. It eliminates the need to export, import, etc.

    April 7th, 2007 at 8:01 pm
  4. 4
    Aaron Brazell Says:

    That’s insane, Doug. :) You run the risk of data corruption that way AND you save no effort doing it that way. :)

    April 9th, 2007 at 9:16 am
  5. 5
    Douglas Karr Says:

    Really? I’ve done it a bunch of times and haven’t had a problem. MySQL simply saves the data in optimized data files. Why does this risk corruption? As for savings, you save the import and export effort.

    To me it appears the same as taking a MSSQL server, detaching it, and moving it. No?

    April 9th, 2007 at 9:53 am
  6. 6
    Ben Klang Says:

    Simply taking a copy of the MySQL data files is inherently dangerous *if the database is running.* The reason for this is that database files are not static things; any time the database changes in any way, many places inside the data files are changed (indices, content, auto increment fields, etc). It is similar to pulling the power from your computer rather than shutting it down.

    All that being said, if you can actually shut down MySQL it is then safe to take a copy of the database files. This is sometimes called a cold backup.

    For more information on safe ways to back up your database, see the relevant documentation. MySQL’s can be found here:
    (Three different versions of MySQL)
    http://dev.mysql.com/doc/refman/4.1/en/disaster-prevention.html
    http://dev.mysql.com/doc/refman/5.0/en/disaster-prevention.html
    http://dev.mysql.com/doc/refman/5.1/en/disaster-prevention.html

    May 9th, 2007 at 4:09 pm
  7. 7
    Abel Says:

    Very useful. Now I’m no longer ’scared stupid’ of using ssh :). Thanks!

    April 30th, 2008 at 6:53 pm

Or add a Video Comment
with
« Back to text comment
  • Recent Posts

    • Western Style Writing vs. Eastern Style Writing
    • How Has Social Software Changed Your Life?
    • America the Beautiful
    • Identi.ca and the Art of the Launch
    • Job Search: Define Your Goals
  • Reader Contribution

    • Sean on Western Style Writing vs. Eastern Style Writing
    • Leslie Poston on Western Style Writing vs. Eastern Style Writing
    • Betsy Buchanan on 10 Things You Need to Know About WordPress 2.6
    • Aaron Brazell on Western Style Writing vs. Eastern Style Writing
    • Igor The Troll on Western Style Writing vs. Eastern Style Writing
  • RSS Venture Files

    • The Difference Between Designers and Marketers
    • But this worked four years ago?
    • Rules for Entrepreneurs - Avoid relying on a few whale customers
    • 6 Steps to Successful Small Business PR
    • Rules for Entrepreneurs - Outsource what you suck at
  • RSS Wicked Marketing

    • Yeah it’s cheaper, but what are you really getting?
    • What a designer is and isn’t…seriously you need to know…
    • The difference between success and closing next year…
    • It’s time to get Wicked…
  • RSS Technosailor en Español

    • PopTok: usa tus películas favoritas para enviar un mensaje
    • Video en Vivo desde tu iPhone
    • 7 Funciones que le Faltan al iPhone 3G
    • Como Vencer la Sobrecarga Informativa
    • La Batalla es Digital
  • Tip Jar


  • License Creative Commons Attribution-Noncommercial-Share Alike 3.0 | Copyright © 2004 - 2008 - Aaron Brazell | Lisa helped out | Privacy Policy

    Twitter Pitch!

    <p>Twitter pitching is a form of pitch that requires succint "what does this mean for me" kind of pitching. It is the ultimate efficiency of words. You have 140 characters or less to tell me why your pitch matters to me or my readers. Please include a means of contacting you. This is included in your 140 characters. If you send successive pitches, you will likely be ignored, unless it's obvious that the first pitch was a case of "accidental send", etc.</p> <p>This form of pitching does not mean I'm being a diva. It means that my time is valuable, and you want a piece of it. It's good practice for you, and delivers your pitch in a format I want. Win-win.</p>


    (X) Close

    Twitter Pitch Me!