Migrate d2d picture migration destination path incorrect 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' =&gt; 'abcdPicture',
  'description' =&gt; t('Import Drupal 6 picture files'),
  'default_uid' =&gt; 1,
  'source_dir' =&gt; '/',
  'destination_dir' =&gt; '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  -&gt; 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!
You may try to specify the destination_dir in the __construct() instead of passing the arguments e.g.

class FooUserPictureMigration extends DrupalPicture6Migration {

  public function __construct(array $args) {
    parent::__construct($args);

    // Add simple field mappings
    $this-&gt;addFieldMapping('source_dir', FALSE)
         -&gt;defaultValue(MIGRATE_D6_USERPIC_SRC_DIR);
     $this-&gt;addFieldMapping('destination_dir', FALSE)
         -&gt;defaultValue(MIGRATE_D6_USERPIC_DST_DIR);


Where MIGRATE_D6_USERPIC_SRC_DIR is your source dir and MIGRATE_D6_USERPIC_DST_DIR is your destination dir (e.g. public://pictures).



Alternatively you can fix the user avatars by the following one-time query:

UPDATE users u
SET picture = (SELECT fid FROM file_managed fm WHERE filename = (SELECT SUBSTRING_INDEX(picture, '/', -1) as filename FROM DRUPAL6_DB.users as d6u WHERE name = u.name AND picture &lt;&gt; '' AND fm.filename = SUBSTRING_INDEX(picture, '/', -1)))
  WHERE u.name &lt;&gt; '' 
    AND u.name IN (SELECT name FROM DRUPAL6_DB.users WHERE picture &lt;&gt; '')


WHERE DRUPAL6_DB is your database name for Drupal 6.