I am new with migration and came across an issue while migrating User picture. For background, I am migrating Users from Drupal 7 site to Drupal 7 on different server.

I am able to migrate users perfectly but the only issue that I am facing is physical migration of user pictures. Following is my code for picture migration:

<?php
  $arguments = $common_arguments + array(
    'class_name' => 'UserMigration',
    'description' => t('Migration of users'),
    'machine_name' => 'User',
    'role_migration' => 'Role',
    'picture_migration' => 'Picture',
  );

  Migration::registerMigration($arguments['class_name'], $arguments['machine_name'],$arguments);

  $role_arguments = $common_arguments + array(
    'machine_name' => 'Role',
    'description' => t('Migration of user roles'),
    'role_mappings' => array(
       'administrator' => 'administrator',
       'editor' => 'editor',
       '....'
     ),
  );

  Migration::registerMigration('DrupalRole7Migration', $role_arguments['machine_name'], $role_arguments);

  $picture_arguments = $common_arguments + array(
    'machine_name' => 'Picture',
    'description' => t('Migration of user picture'),
    'default_uid' => 1,
    'source_dir' => '/tmp/files/pictures',
    'destination_dir' => 'public://',
  );
  Migration::registerMigration('DrupalPicture7Migration', $picture_arguments['machine_name'], $picture_arguments);

?>

Since images are on different server and I read files must be copied to a folder on the same server so I copied all the image files to /tmp/files/pictures/ but migration failed. Also, to check if the migration works I copied the files to target file folder the migration works flawlessly. It maps pictures to correct user but I want physical migration of files.

Is it possible to achieve this? I followed few discussions on this but was not able to following it. Can someone please guide me with this? If my explanation is not clear and if you need more information please let me know. Thank you in advance.

Comments

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

You shouldn't need to do a manual copy of pictures locally, you should be able to migrate them directly from the source server - specify source_dir as, for example, http://example.com/sites/default/files/.

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)