Migrating content into a Drupal site

I've just finished a pretty big migration, from a very custom Xoops site to Drupal. Luckily for me I didn't have to get messy with the original Xoops tables, which were all over the place from multiple upgrades and on-the-roll customisations. For me the task was clean up the data and get it into Drupal appropriately - a reasonably easy, if not fast, thing to do if you have the right tools to hand.

It had been some time since I'd done a migration to Drupal. Not since the passing of Flexinode and the rise of CCK, but from experience working with the FeedAPI and FeedAPI Element Mapper I already knew the way to go creating node objects and using the Drupal node_save() function. This being a pretty complicated site there are a whole host of hooks that need to be called for every node or, if you don't do that, have to be recreated.

So there is some handy code and notes that I'm going to record here.