“Import WordPress” – painfully..

One of the newer features in WordPress 2.1.x onwards is the ability to export and import almost all the content from a WordPress install using a WXR file. The file contains (to quote) “posts, comments, custom fields, pages, and categories” and if you are starting a fresh WordPress install on a new site or just taking a backup, it’s a very convenient and handy thing.

Except there are a couple of issues:

  • The import process has a hard limit of 2MB. In other words, a file larger than 2 MB simply cannot be imported. Given that my small blog in WP 2.3 generates a 1.8MB file, it would have been useful if the export process could generate multiple files of a some pre-defined size to ensure we don’t hit this limit. Unfortunately that option doesn’t exist.
  • Far more frustrating is how unreliable the whole import process is. Over the last few weeks, I’ve been forced to scrub my Dev install and start over (for various reasons) and each time, I’ve had the same problem – the importer will not load all posts at one go and with each pass, the number of posts not imported so far that get added becomes smaller and smaller. For example, pass 1 will import 30 posts, pass 2 of the same file 18 posts and pass 3 might not import anything new at all!

I have tried various tricks and so far none of them will get WordPress to load the whole file at one pass. What I have managed to do however is to ensure that it loads atleast 20-30 new posts each time. Every time a file gets loaded, take note of the last post that got imported. Then open up the XML file in a text editor , search for that post and delete everything in the file before that, but keep the tags section. Save the edited file with a new name and then start the import process again.

Removing already imported content and giving it a new name seems to force some kind of cache refresh and keeps the import process moving quickly. It’s a pretty bad workaround though and I’m not looking forward to having to do this when I relaunch the blog.

There are several threads on the WordPress to WordPress import function on the Support forums, but nothing that seems similar to what I’m seeing.

I was hoping to keep my Dev environment up-to-date using this option, but the effort involved in this makes me think I don’t have much chance of that.

Comments are closed.