File migrations are a bit tricky. Files get their own class and registration, as if they themselves were a node like a Book Page. Basically, files have to be imported separately and then mapped to the content type they belong to. Here is the file code you will need for a migration:
class osu_migrateFileMigration extends DrupalFile6Migration {
/**
* Constructor
*/
public function __construct(array $arguments) {
if ((!isset($arguments['destination_dir']) ||
empty($arguments['destination_dir']) ||
$arguments['destination_dir'] == 'public://')
&& isset($arguments['og_group_id'])
&& !empty($arguments['og_group_id']))
{
$group_name = osu_migrate_get_group_name($arguments['og_group_id']);
if ($group_name) {
$arguments['destination_dir'] = "public://{$group_name}";
}
}
parent::__construct($arguments);
}
/**
* Custom error handler
*/
public function errorHandler($error_level, $message, $filename,
$line, $context)
{
// If a file fails to save, let the user know (If they want errors).
if ($error_level && stristr($message, 'mkdir(): permission denied')) {
$output = "Could not mkdir() in destination path: Permission denied";
$this->saveMessage($message, MigrationBase::MESSAGE_ERROR);
throw new MigrateException('ERROR: ' . $output,
MigrationBase::MESSAGE_ERROR);
}
else if ($error_level && stristr($message, 'failed to open stream')) {
$this->saveMessage($message, MigrationBase::MESSAGE_NOTICE);
throw new MigrateException('NOTICE: ' . $message,
MigrationBase::MESSAGE_NOTICE);
}
}
}
This code can either go in a separate file (such as file.inc) or be included in node.inc. Next, you need to point the mapping to the file migration in node.inc like so:
$this->addFieldMapping('field_picture', 'field_photo')
->sourceMigration('File');
Of course, you are still free to use prepareRow() to manipulate file data as necessary.