Migrating user profile picture from D6 to D7 I'm migrating a site from D6 to D7 and I want to do the User migration in code. The basic profile works fine except for the user picture. I read that it's best to write a separate class for this file so I did. Unfortunately I'm getting nowhere with it.
Can you see anything wrong with this code? I plan to use this class as a dependency in the user profile migration class where I should be able to attach the image based on file id generated in this class.

class MigrateDAFiles extends Migration {
    public function __construct(array $arguments) {
        $this-&gt;arguments = $arguments;
        parent::__construct($this-&gt;arguments);
        $this-&gt;description = t('Profile images');
        $this-&gt;map = new MigrateSQLMap($this-&gt;machineName,
            array(
                'picture' =&gt; array(
                    'type' =&gt; 'varchar',
                    'length' =&gt; 255,
                    'not null' =&gt; TRUE,
                ),
            ),
            MigrateDestinationFile::getKeySchema()
        );
        $this-&gt;destination = new MigrateDestinationFile();
        $query = db_select('users', 'u')
            -&gt;fields('u', array('picture'))
            -&gt;isNotNull('picture');
        $query-&gt;distinct();
        $this-&gt;source = new MigrateSourceSQL($query);

        $this-&gt;addFieldMapping('value', 'picture');
        $this-&gt;addFieldMapping('source_dir')-&gt;defaultValue('http://www.example.com/sites/default/files/artist-pictures/');
        $this-&gt;addFieldMapping('file_replace')-&gt;defaultValue(FILE_EXISTS_REPLACE);
        $this-&gt;addFieldMapping('status')-&gt;defaultValue(1);

        $this-&gt;removeFieldMapping('path');
}
I believe you need to do picture migration separately per the docs (assuming you are using Migrate D2D, which you probably should).  This is all I had for picture migration from one I did last year:

$picture_arguments = $common_arguments + array(
  'machine_name' =&gt; 'pictures',
  'description' =&gt; t('Migration of user pictures from Drupal 6'),
  'default_uid' =&gt; 1,
  'source_dir' =&gt; '/some/path/to/sites/default/files/',
  'destination_dir' =&gt; 'public://pictures',
);

Migration::registerMigration('DrupalPicture6Migration', $picture_arguments['machine_name'], $picture_arguments);