Posts from January 24, 2007

fun with Habari

Theres been a lot of excitement and discussion recently about the emergence of a new blogging platform called Habari.

A brand new blogging platform being created from scratch with more developers than actual blogs.The prospect of my blog being completely broken by the nightly alpha build was an attractive one. A chance to leave the comfort of a stable Wordpress environment with all those themes and plugins. A change to live on the bleeding edge. I desperately tried to resist but the lure was too strong. In the end, I simply couldn't help myself.

The first step was to install subversion (much better name than boring old CVS) on Bluehost following these excellent, idiot-proof instructions.

Then you check out the habari code. Or rather you don't. You get this error.

svn: PROPFIND request failed on '/svn/trunk'
svn: No transaction named '26572b6d78b0be18? in filesystem 'habari'

No need to give up and commit Hari-Kari just yet. Consult the Habari self-help group to discover there is a known problem with the SVN repository on the Google server. When this problem is resolved, I finally get to download the code. Habari requires PHP5 and PDO (for database access). On Bluehost, the following lines must be added to 'php.ini' to activate the PDO drivers for mySQL.

extension_dir = /usr/lib/php/extensions/no-debug-non-zts-20050922
extension=pdo.so
extension=pdo_mysql.so

I am already hosted on a server running PHP5 but if you don't have PHP5 on your server, open a ticket and Bluehost Technical Support will promptly move you.

Create a(nother) mySQL database and account, edit the database credentials in 'config.php', create an '.htaccess' file to handle redirects and you're away. A simple installation page creates the initial user account, the blog, tagline and the first entry.

Congratulations ! You are now the proud owner of a Habari blog.

Obviously, this is an embryonic product but the Administration page looks great and is fast and responsive. Although I'm not sure I believe the traffic statistics !

The article editor is a little minimalistic (especially contrasted with the recently released WordPress 2.1) but perfectly usable.

A special word of praise about the Habari import facility.

This connected directly to my Wordpress database and was blindingly fast (less than 30 seconds) to import my WordPress blog. In fact, it was so fast, I had to check that over 500 articles and 400 comments were indeed correctly imported although I noted that tags weren't preserved.

It is not clear how you might import a hosted Wordpress blog where you don't have access to the database but I am sure other data formats will be added in due course.

Of course, there isn't the rich variety of themes and plugins available for Habari (yet) and, while I will not be jumping ship to Habari from WordPress today, I will certainly continue to follow developments with interest.

Auto-discovery detected the availability RSD and Atom (but not RSS) feeds.

If you're interested, here is my Habari sandpit.

lost in transit

Last night I returned to London from Brussels. Unfortunately, my overnight bag didnt.

I guess this was inevitable after four years of multiple short flights in Europe and I have been pretty lucky thus far.

Curiously, two other passengers on my flight suffered the same fate. One gentleman was very irate. For reasons best known to himself, he had buried his car keys in his suitcase which seemed a very odd decision.

Consequently, he had to call his wife in Oxford to drive down to Heathrow with the spare keys. I happened to notice he held his mobile phone a full 12 inches from his ear while he made the call to his loving partner. Hopefully, the box of expensive Belgian chocolates he was carrying, may help to salvage the situation.

My immediate thought was the stray bags were lurking somewhere in Heathrow Terminal 1 whereas my new friend and ally seemed convinced that they had never left Brussels. He was insistent that Hercule Poirot was summoned immediately to locate the bags in Brussels and placed on the 20:00 flight (in business class with cloth napkins).

My gut instinct was reinforced when four more passengers from Amsterdam came over to report more lost bags. Again, from the now sadly empty luggage carousel 4. Maybe there was something interesting on TV or a baggage handler had popped out for more tea-bags.

Ironically, I was deputising at short notice for a sick colleague so this flight was booked at very short notice in business class. So, the bright orange 'Prioritaire' tag didn't exactly help my kit bag much on this occasion.

Anyway, I remain hopeful of getting my smelly clothes and stolen hotel toiletries back; particularly when I read this bold assertion on the BMI claim form

'We would like to assure you that every effort is being made to locate your bag using a world-wide computer network designed exclusively for this purpose.'

fun with disaster recovery

Sort of.

I decided to remove all posts from my newly created Habari sandbox in case my readership and GoogleBot gets confused. As there was no obvious bulk deletion tool, I simply truncated the `wp_posts` table.

Unfortunately, I truncated the `wp_posts` table from the Wordpress schema instead of the Habari schema.

So, in the space of a mere 24 hours, I had managed to lose my favourite boxer shorts, get a brand new shiny blog and then completely trash my established, trusty, stable blog.

No problem. Earlier today I upgraded to WordPress 2.1 so I can use the backup I carefully took before that upgrade. Only the Bluehost one-click upgrades are so reliable and trouble-free, I got out of the excellent habit of taking my own backup by hand.

No problem. I will just use the backup Bluehost took automatically. Only I can't. That backup is purely of the PHP code (and not the database).

No problem. I will simply use the Bluehost mySQL database backup. Only I can't. Murphy has spoken. The latest daily backup has been made in the last 2 hours and the `wp_posts` table is empty.

No problem. I will go back to the weekly dump, extract the SQL for `wp_posts` in isolation and add the raw data by executing the INSERT statements.

That all works fine. 502 records inserted into `wp_posts`. Triumphantly, I pat myself on the back and check the blog looks OK. There are still no articles. Weird.

I create a test article, which is visible, and compare the 'good' record against the 'bad' record. Quickly track the problem to the 'post_type' column which is NULL on the imported posts and should be 'post'. Issue the necessary UPDATE statement and, magically, all my posts immediately re-appear. Fix the 'About' page which imaginatively has a 'post_type' of 'page'.

All that remains is to fill in the gap between last week's backup by manually pasting in articles from Google Reader and modifying the timestamps. Slightly tedious but much preferable to laboriously typing in 501 articles.

And the moral of this tale. If I ever cross your threshold to be interviewed for that production DBA role for a large Siebel deployment, just thank me and politely show me the door. Quickly.