I'm in the process of building a migration module for a d6 to d7 migration using the d2d module.
I'm almost there, but one thing that's holding me back is the DrupalPicture6Migration. After trial and error, this is what I have (using the d2d documentation):
/* Register the picture migration */
$picture_arguments = $common_arguments + array(
'machine_name' => 'abcdPicture',
'description' => t('Import Drupal 6 picture files'),
'default_uid' => 1,
'source_dir' => '/',
'destination_dir' => 'public://pictures',
);
Migration::registerMigration('DrupalPicture6Migration', $picture_arguments['machine_name'], $picture_arguments);
}
source_dir points to the correct location: /sites/default/files/userPictures.
I'd expect the migration to go like this:
'sites/default/files/userPictures/picture-1589309970.jpg -> public://pictures/picture-1589309970.jpg.
But when I perform the migration, the path gets migrated over instead of the pictures. So I end up recieving this error:
'The specified file sites/default/files/userPictures/picture-1589309970.jpg could not be copied to public://pictures/sites/default/files/userPictures/picture-1589309970.jpg.
The entire path sites/default/files/userPictures/picture-xx.jpg is copied into the public://pictures directory.
I am reading up on using destination_file but am failing to make the connection on how I'd code this.
Thanks!