Rss Archive Importer for WordPress

January 28, 2006 on 5:22 pm | In Coding | 6 Comments

Here is an importer for RSS-format archives into WordPress 2.0:

WordPress RSS Archive importer v1.1

It is based on the RSS importer that ships with WordPress 2.0, but it has been changed to work with my 20six backup script and windows tool. These download comments as well as simply posts, and use html ‘div’ tags to indicate where each comment is, whilst keeping the same format as 20six comments (including ‘sweeties awarded’). It also does a better job than 20six at spotting comment spam – it will import them but flag them as ‘needs moderation’.
To use it, download the zip file, unzip and upload rss-archive.php to your WordPress installation at /wp-admin/import/ and then upload your archive-myblog-year.xml files to /import/ and your images to /images/, on your web server. (use any FTP program to do this; the details will vary according to your web site configuration)

Then simply go to the WordPress admin page at /wp-admin/ in your web browser, click on Import and then RSS Archive, and just choose the archive to use! I will be using this to import my old 20six posts to this blog later today, and bobble is going to be using it as well!

To archive your 20six blog:

Use the PHP Archive Script or Windows users may want to use my Windows 20six Backup tool. It doesn’t have full support for tagging comments yet, but it probably will do in a couple of days. (Currently the comments are imported as part of the post, rather than as ‘proper’ WordPress comments)

Updated: version 1.1 now copes better with blogs that use tables in comment formatting, rather than line breaks.

6 Comments »

RSS feed for comments on this post. Add Comment Feed to Bloglines. TrackBack URI

  1. [...] You can use it with the WordPress RSS Archive Importer to transfer your blog from 20six to WordPress. Yippee! [...]

    Pingback by technobubble.info » 20six Archive PHP script — 28 January 2006 #

  2. Hi Bubb,

    I’m not sure if this is your thing, or what, but I don’t have any better ideas. I’m trying to use your importer to import my 20six blog archives, produced using your superb 20six archive php script, to my WP blog – but I’m getting the following WP error message after Step 1 (“Choose blogs”):

    Warning: opendir(/home/[username]/[domain]/import): failed to open dir: No such file or directory in /home/.catlin/[username]/[domain]/wp-admin/import/rss_archive.php on line 51

    (My username & domain name appear where the square brackets are).

    Any idea would be appreciated.

    Thanks,

    menace

    Comment by menace & KE — 4 February 2006 #

  3. hmm.
    I think the problem is that it can’t find the directory /import/ which it expects to find the .xml files in.

    This could happen if your WordPress isn’t installed in the root of the web server… Where did you copy the .xml files to?

    If you want to change the directory that the script looks in, open it in a text editor and lo
    ok for the lines:

    function get_archive_file_path ($filename)
    {
    return $_SERVER['DOCUMENT_ROOT'] . '/import/' . $filename;
    }

    function list_blogs()
    {
    // list files in the /import/ directory
    // create a handle for the directory
    $handle = opendir($_SERVER['DOCUMENT_ROOT'] . '/import');

    If you replace $_SERVER['DOCUMENT_ROOT'] with whatever the folder should be, it should (hopefully) work.

    Comment by admin — 4 February 2006 #

  4. Yeah, you’re right – I thought WP was in my root but apparently not so I modified the code like you suggested. All’s working fine now. Thanks. Meanwhile my other half seems to have a problem importing her comments – it’s a bit of a weird one so I’ve emailed you. Hope you don’t mind.

    Cheers again.

    Comment by menace — 6 February 2006 #

  5. Ok, updated version posted – many thanks for the xml file to test on!

    Comment by admin — 6 February 2006 #

  6. Hi there

    Thanks so much for creating this backup tool. I backed up my 20six blog (20six.co.uk/adam_ball) using your tool and have just set myself up with a new blog at http://www.adamball.net. My site is mainly for family – family stories and pictures.

    When I tried to import I had exactly the same problem as Menace – see the error below – but as I’ve no experience with scripting I don’t know how to edit the folder location.

    Warning: opendir(/home/adamball/public_html/import): failed to open dir: No such file or directory in /home/adamball/public_html/wp-admin/import/rss_archive.php on line 51

    My xml files are in /import and images in /images. Your php file is in /import.

    You say I need to replace $_SERVER['DOCUMENT_ROOT'] with whatever the folder should be.

    What’s the syntax? $_SERVER(‘/public_html’)

    Clueless and I don’t want to mess up the installation!

    Thanks

    Adam

    Comment by Adam Ball — 17 July 2006 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Creative Commons License This work is licensed under a Creative Commons Attribution 2.5 License.
Powered by WordPress with Pool theme design by Borja Fernandez, modified by bubb.
Entries and comments feeds. Valid XHTML and CSS. ^Top^