Drupal 4.7 migration to Drupal 7 - Files - Part 4

This is the fourth installment of my saga of upgrading my Drupal 4.7 internal knowledgebase to Drupal 7.

So far I had managed to convince d2d to bring my book based Drupal 4.7 knowledgebase over to a fresh new Drupal 7 installation. But no attached files.

The first REALLY obvious issue was that the default book content type has no means to support attached files. Oops. In Drupal 7 you need a File field. Required solution was to alter the default book content type to include a File field ("unlimited values" since I attached multiple files in 4.7). File types? What? Yes - Drupal 7 got sticky about file extensions and wanted to list all of them. So I jammed in Allow All File Extensions to solve this issue.

Nirvana was expected. Not achieved.

I tried several variations of pre-importing & then attaching versus import as required and all failed miserably.

I finally settled upon a scheme of pre importing all files, hacking node.inc to obtain a list of source fids, translating these to target fids and then providing a nicely formatted list of fids to one of the magic file handlers of d2d.

Success! Even better, repeatable success as I preformed the end to end migration several times as proof of concept trials.