Update to WordPress Migration Script

I’ve updated the Habari to WordPress migration script from my last post. As special thanks to someone who pointed out that comments weren’t being associated with the right posts, they were totally off because I forgot to translate the old Habari post ID to the new Wordpress ID… Whoops.

The script can be found via my original post, it’s just been silently updated in place.

Again, best of luck to anyone using it…

Update 10/11/09: One more update related to post comment counts – we only want to ‘count’ ones that have been approved. Again, the original link has been updated.

Post Meta

9-19-2009
Date
11:01 pm
Time
752
Views
100
Words
Comments
Comment Feeds

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
985
Views
386
Words
Comments
Comment Feeds

From WordPress to Habari

Back in February I started becoming interested in this new blogging project called Habari. I, like most people, had been using WordPress for years on what passed for my pathetic excuse for a blog.

Over those years I went through phases of love and hate for WordPress as they branched out and tried new things. Often it seemed that the good came hand-in-hand with the bad. While striving to improve their product and push adoption to the masses, many changes seemed to forsake those hard core users who had been loyal all along.

With the creation of the wordpress.com hosted platform and the funding of Automattic to continue to improve and pursue these ventures, things really began to take a turn for the worse. The line between open source and commercial venture began to blur, and continued development seemed to focus on the hosted aspect, rather than the self-hosted community. Some features did trickle back down, but the gap continued to grow as time went on.

Along the way, something totally unrelated to WordPress and the blogging world happened. My coding skills improved. While I had previously been content to harness the awesome power of the WordPress plugin system, I now felt the need to branch out and spread my coding wings. Realizing that the WordPress code base was a mess of PHP4 code, global functions and variables, and lacked any documentation at all, I became frustrated trying to make changes. Since that time, WordPress has attempted to make strides in the documentation and global functions areas, but for the most part the codebase remains as messy as ever.

Looking for alternatives, I happened to stumble upon Habari. Several people I’d known from the WordPress IRC channel had begun to frequent their IRC channel as well, and I migrated over mainly to have more people to chat with regularly. As I became more familiar with the people involved and started participating in some of the arguments happening around functionality and usability, I began to become more and more interested in the product as a whole.

Habari is totally PHP5-based. It doesn’t sacrifice functionality to appease a few misguided souls who believe PHP4 was the perfect development platform for an open source application. It’s also focused on providing the most reliable and flexible blogging experience possible (for example, it supports MySQL, SQLite, and Postgres out of the box). This kind of dedication to providing a system that will (eventually) run on any combination of technologies is really what sets Habari apart from most of the other platforms available. It’s not just about the database systems it supports, because that same approach is taken with everything: make it modular so people can substitute in their own pieces to create a system that works for them.

At the same time, close attention is paid to the quality and reliability of the code written to support these features. Not only is it heavily object-oriented, but it’s also very flexible (the two do generally go hand-in-hand) and of a high quality, which improves extensibility and performance greatly.

Don’t believe me? How about an example? Here’s a Pingdom response time graph of my blog moving from WordPress to Habari on the same Slicehost VPS:

Response Time Graph

Response times go from 900 – 1,250 ms on WordPress to 550 – 600 ms on Habari with the same content (and actually both were running their respective K2 themes) on the same server. Not only did Habari cut response times in half, but it is also much more consistent. Those 300 ms spikes are no longer a problem, it’s smooth sailing the blogging seas onboard the S.S. Habari.

If you haven’t given Habari a look, or have only tried an older version, I encourage you to test drive the latest development code straight out of SVN. It’s leaps and bounds beyond the 0.5 release and growing closer and closer to a 0.6 release every day. You should also take a few minutes to stop by the #habari IRC channel on irc.freenode.net and say hi – our community is half the value.

Post Meta

11-7-2008
Date
11:00 am
Time
542
Views
680
Words
Comments
Comment Feeds

IETester and Javascript Errors

I was playing with IETester, which lets you open Internet Explorer tabs using rendering engines from IE 5.5 up to IE 8 beta 1 for testing compatibility, and noticed for the first time that my blog was throwing a Javascript error only in IE.

Being the pain in the ass IE is, of course the line number it gives isn’t really valid. I looked and looked and couldn’t find the problem. As a last ditch effort, using the IE Developer Toolbar, I hit the menu option to validate the page. Thanks to the W3C Validator, I found that there were some duplicate ID attributes on elements.

After checking out the lines the validator referenced, I found that the Google Analytics plugin for WordPress was improperly tearing apart href attributes for links created by the Footnotes plugin I use, causing it to include long strings of HTML in the onclick attribute for tracking outgoing links1.

Thankfully, the Analytics plugin has an option to turn off outbound link tracking. I’ll miss those stats, but it’s not like I pay all that much attention to them (or care) anyway.

In the end, I don’t really have anything to test with IETester, it was just a fun toy for a few minutes. It also helped me notice a problem I probably wouldn’t have found otherwise, so in the end it was time well spent.

  1. Rather than just the link the user was headed for, as it should – and does for regular links. []

Post Meta

6-3-2008
Date
9:21 am
Time
412
Views
247
Words
Comments
Comment Feeds

New Kick-Ass Wallpapers

I had the opportunity to do some quick WordPress plugin hacking tonight1 for Jim Whimpey. As a “payment” of sorts, he gave me a coupon code for the site he was working on: Panedia Desktop Wallpaper.

Being an Aussie company, obviously, most of their wallpapers are from Australia. Boy do they have some absolutely beautiful scenery down under. Check out the two I selected for my machines:

For my desktop, I got a huge 3200 x 1200 pixel version of Brisbane’s beautiful night skyline:

New Desktop Wallpaper

And for my MacBook Pro, I got a beautiful 1680 x 1050 pixel copy of the Robe Coastline:

New MBP Wallpaper

Stunning wallpapers. Totally worth $25/year to constantly get new beautiful scenes in this kind of quality. I also love the interface that auto-picks the best format for your OS and resolution. Very well done.

  1. I added an additional search option to the Search Everything plugin, enabling it to return all posts in a matching category. []

Post Meta

4-20-2008
Date
10:01 pm
Time
478
Views
153
Words
Comments
Comment Feeds