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

Post Meta

8-22-2009
Date
12:59 am
Time
1025
Views
386
Words
Comments
Comment Feeds

Lots of Habari Hacking

After a whole week of being sick and generally not feeling well enough to work on anything, I’ve finally gotten back to hacking on some Habari code.

I’ve been up until about 5am the last two mornings working on a variety of things. Yesterday included a plugin directory plugin that hopefully will eventually find a home on the Habari servers providing directory and update notification services. I also had the opportunity to track down an obscure database class error while helping add some new tag merging / renaming functionality.

This morning I’ve been hammering away at a new database schema for Oracle. All in all there aren’t a lot of changes, but things like the lack of auto_increment fields1 made it a very time-consuming process.

Tomorrow I hope to get some more work done on Oracle support (hopefully allowing me to test a running blog, if not the installation and other backend functionality) and finish some updates I’ve had planned for the Monthly Archives plugin for far too long.

At some point in the next couple of days I would also love to rearrange my desk. Unfortunately that means I first have to clean it off, which is a much larger task than it should be…

  1. Or the convenient SERIAL data type in Postgres which emulates the trigger / sequence functionality. []

Post Meta

5-17-2008
Date
12:26 am
Time
170
Views
220
Words
Comments
Comment Feeds