May 26, 2007

Improved Wordpress to Wordpress Importer

I’ve been playing around with importing WordPress blogs from one instance to another, and I’ve been frustrated by some of the default features of the built in WordPress to WordPress importer.

So, I’ve implemented a new version of the importer that has the following features:

Attachments – This importer will download and “insert” the actual image files of an attachment record. So for example, if you’ve uploaded images to your WordPress blog, then they will be listed as attachments. The normal importer will store these records but no do anything with the actual image. So you basically end up with dead links. Not anymore. Now if the image is an attachment, the importer will attempt to download it and insert it into the new blog. All of this downloading happens on your server, so you don’t actually have the files download to your client machine.

Links – Links to your own blog are remapped. This is particularly important for image links to attachments (obviously) or else the attachment feature described above would be pretty whacked! But it also applies to cross links between your own blog posts. Seems like an obvious feature right? I thought so. This also applies to internal ping backs.

Spam Comments – For some reason the default importer decides to import comments tagged as spam. I guess I can imagine a few cases where this might make sense… but nah… I don’t think so. So this importer will discard any comments marked as spam.

Installation: Download the code from the link below. Rename the file to zappo_wordpress.php and place it in your wp-admin/import directory.

When I run your script inside WPMU 1.2.1 I get the same error that I get when I run the standard WP->WP import script. I’ve got an exported XML file from a standalone instance of WP 2.1.3, and when I try to import it into WPMU i get the following error:

Warning: Invalid argument supplied for foreach() in C:\www\webroot\wordpressmu\wp-admin\import\zappo_wordpress.php on line 441

This shows up both in your script and in wordpress.php (diff’t line numbers).

Hey – thanks for writing. The error would appear benign in the case that both the exported an imported blogs had one author, but otherwise it isn’t. basically it’s crapping out on recognizing the author of each of the exported posts, even though just before import the script was able to recognize that there were multiple authors being imported and asked which new authors to map them to… after the import (and the error messages), the author of every post is the main admin…

i can send you the xml — drop me an email at this address and i’ll reply with it. i’m going to upgrade the export blog to 2.2 tomorrow and see if that changes anything.

[…] own full version of WordPress. For more information on moving your blog, see Importing Content, Improved WordPress to WordPress Importer, and Can I move my blog from here to another blog somewhere else … from the WordPress.com […]

Hello Zappo! Do you still actively develop this plugin? I tries to use in under the current WPMU 1.2.4 , but there are som problems. First there is a missing include, to use register_importer (from admin-functions.php). I needs some other functions too, I added includes, but it still says “Cannot load importer.” when I try to use it. Thanks…

When I initially commented I seem to have clicked the -Notify
me when new comments are added- checkbox and from now on each time a comment is added I recieve 4 emails with
the exact same comment. Is there a means you can remove me from that service?
Thank you!

I actually consider this specific blog post , “Improved WordPress to WordPress Importer | Hefta-Gaub
Development Blog”, pretty pleasurable and the post was a remarkable read.
Thanks for the post-Kristopher

Sweat365.com

What is Sweat365.com? In a nutshell it is a fitness portal with a blogging platform based on WordpressMU. We've implemented a great deal of proprietary code to make this platform include an integrate online training tool.