Confessions of a Guru....

18 February 2008

Link Dump

For later, when I have time to investigate...

Custom Search

11 February 2008

Blogger to Drupal, some meat

Ok, so here's some meat. I'm not there yet because this script doesn't import comments, nor have I shared my blog tagger with you (need to find/document that) but this might help those impatient among you.

Click to view import_post_to_drupal.php

Good luck.

Oh, by the way (and this had me stumped for a bit) you need to paste this into Drupal as PHP content. You can't do that until you go into Administer -> Site Building -> Modules and enable the "PHP Filter" module. Once you've done that you should be able to select "PHP Code" as an input type when you create a page or story.

Custom Search

05 February 2008

Planning the migration

Well, so far with the planned Drupal migration, so good. I'll outline the approach I'm taking:

1. Tag my current blog.

Because Blogger doesn't (seem to) have an export function, I've gone for the age old method of content scraping. If you view the source for this page you will see chunks of HTML comment that look like this: (etc). These have been automatically generated by a script that reads the Blogger template and puts HTML comments around the Blogger content tags. BDMT is short for Blogger Drupal Migration Tag by the way. This method seems to be a popular way of progressing a migration.

2. Parse the tagged blog.

So, once these comments are in place I can then read the contents of my blog and use a simple regex to extract those bits of text between the comments, nicely indexed by the name of the comment itself.

3. Import into Drupal.

This was causing me some grief, but I've noticed that since playing around with the drupal_execute method the API documentation for v6 of Drupal has been updated. I've just run a quick test of the new code and created my first ever post, programatically. The rest should be plain sailing.

So far I've got scripts for steps one and two, but my PC is out of action at the moment (warranty replacement) so this project will be on hold for a little bit.

Labels: , ,

Custom Search