Migrating Habari to WordPress

While of course we never like to see anyone give up on Habari, it’s obviously not going to be the perfect platform for everyone. Hopefully most people will test it out before they make a final switch, but for those who get stuck and wish to switch back to WordPress (and we know you’re out there), I’ve finally throw together a quick script that should help.

Things this migrates:

  • Posts – published or draft
  • Pages – published or draft
  • Comments – approved only
  • Tags

A few caveats: this is MySQL-only, if you’re using Habari on Postgres or SQLite I’m sorry. It wouldn’t be especially difficult to change, I just have no interest in doing so – it suites my purposes. It’s also quite hacky. There’s very little error checking (make that practically none) and it prints output in plain text. It’s also not a plugin, I wrote it as a one-off script that you use and immediately trash because that’s exactly what you should do with it.

Also note that it writes directly to the WordPress database tables, it uses none of their API functions. That means the slightest schema change could (and probably will) break the whole thing and that things like filtering and other plugin actions aren’t performed. I was using the trunk build of 2.9-rare, so roll back to about r11867 if you have problems.

Finally, it will set the owner of a post to an existing WordPress user with the same username if one exists – if not it will create a new user account that you can then manage any way you like.

So how do you actually use it? Well, you dump it in your Habari root directory, edit the array at the top so it can connect to the MySQL database your WordPress instance is installed in, and you load it up in your browser. You should see a bunch of junk about things it finds – and hopefully no MySQL errors along the way. If you see any errors, you’re on your own.

On my VPS I was able to import my blog back into WordPress in a matter of about 2 seconds. For those who want or need to switch back, best of luck to you, hope this helps.

Snag the script over here: wp_migrate_script.php

Posted in Uncategorized | Tagged , , , , , , , , | 9 Comments

9 Responses to Migrating Habari to WordPress

  1. Pingback: Update to WordPress Migration Script - Chris Meller

  2. Khaled says:

    Not that I’m thinking of switching (I came by looking for something else entirely), but your links ain’t working…just as a heads up.

  3. Chris Meller says:

    Does now. Thanks for pointing it out!

  4. Pingback: Onward and upward – Fsk141

  5. Pingback: climbing aboad the Habari bandwagon - Habari Watch

  6. Pingback: Hello world! « Am Not So Wise

  7. Pingback: Notizblog verloren!

  8. Pingback: habari – > wordpress | kobak pont org

  9. Pingback: Navigating Habari, the content management system - Part 1 - Jane Talks Tech!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">