How can I use Migrate Extras to get custom media fields to migrate? I'm a bit at the end of my rope in trying to get file fields to show up as possible destinations for my Media module migration.  I have Media 7.1.x installed because as best I can tell, that must be the version that Migrate Extras was supporting.  I'm trying to import files into the Other file type, so I have the following:

$this-&gt;destination = new MigrateDestinationMedia('other');
$this-&gt;map = new MigrateSQLMap($this-&gt;machineName,
      array(
        'id' =&gt; array(
          'type'        =&gt; 'int',
          'length'      =&gt; 11,
          'not null'    =&gt; TRUE,
          'description' =&gt; 'File ID',
          'alias'       =&gt; 'f',
        ),
      ),
      MigrateDestinationMedia::getKeySchema()
    );


Unfortunately I cannot get the field I added to the Other file type to show up as an available destination field in Migrate UI.  Any help on what I'm doing wrong here, or even a code snippet where someone has successfully done a media migration (for files, not youtube or anything fancy like that), would be greatly appreciated!

Update: I'm most of the way there, but my fields still aren't coming in.  Here is the array I created:

I create a $row->fields_array that looks like:

[fields_array] =&gt; Array
    (
        [0] =&gt; Array
            (
                [field_doc_public] =&gt; 1
                [field_testing_testing_testing] =&gt; UE2_3009.pdf
            )

        [1] =&gt; Array
            (
                [field_doc_public] =&gt; 0
                [field_testing_testing_testing] =&gt; UE2_3009.doc
            )

    )


I really only need the field_doc_public field to be filled in, but I added field_testing_testing_testing to test as you might guess from the name.  The field machine names are field_doc_public and field_testing_testing_testing.

The code in the actual migration looks like:

    $this-&gt;addFieldMapping('field_doc_pub_files', 'file_source_file');
    $this-&gt;addFieldMapping('field_doc_pub_files:file_class')
        -&gt;defaultValue('MigrateEntityFileUri');
    $this-&gt;addFieldMapping('field_doc_pub_files:fields', 'fields_array')
        -&gt;description(t('Populate the fields.'));
    $this-&gt;addFieldMapping('field_doc_pub_files:destination_dir')
        -&gt;defaultValue('private://pub_docs');
    $this-&gt;addFieldMapping('field_doc_pub_files:destination_file', 'file_dest_filename');
    $this-&gt;addFieldMapping('field_doc_pub_files:file_replace')
        -&gt;defaultValue(MigrateFileBase::FILE_EXISTS_REUSE);
    $this-&gt;addFieldMapping('field_doc_pub_files:preserve_files')
        -&gt;defaultValue(FALSE);
    $this-&gt;addFieldMapping('field_doc_pub_files:display', file_public);


Any help on that last little push over the finish line would be greatly appreciated.  (Note: no destination for the fields shows up in Migrate UI either)
The following will allow you to use Migrate to import files as File Entities (used for Media 2.x) and populate the File Entity fields when importing Nodes (MigrateDestinationNode). No Migrate Extras needed.

Add the following to your custom migrate module's .info file:

files[] = includes/MigrateEntityFileUri.inc


Download/save the following code in an "includes" subfolder of your migrate module. (Strip the .php extension)
https://gist.github.com/dmsmidt/6f0f498a9dbaea8602fb

Then in your Migration class you can use 'MigrateEntityFileUri' as file_class.

Example code:

$this-&gt;addFieldMapping('field_media', 'your_file_uri_source_array');
$this-&gt;addFieldMapping('field_media:file_class')
  -&gt;defaultValue('MigrateEntityFileUri');
$this-&gt;addFieldMapping('field_media:fields', 'fields_array')
  -&gt;description(t('Populate the fields.'));
$this-&gt;addFieldMapping('field_media:destination_dir')
  -&gt;defaultValue('public://your_file_sub_dir');
$this-&gt;addFieldMapping('field_media:file_replace')
  -&gt;defaultValue(MigrateFileBase::FILE_EXISTS_REUSE);
$this-&gt;addFieldMapping('field_media:preserve_files')
  -&gt;defaultValue(TRUE);


Note the sources: 'your_file_uri_source_array' and 'fields_array'.
You may need to do some processing in prepareRow() depending on your source to get your data organized like this (pseudocode):

public function prepareRow($row) {
    $row-&gt;fields_array = array(
      array(
        'field_one' =&gt; 'value_field_file_one',
        'field_two' =&gt; 'value_field_file_one'
      ),
      array(
        'field_one' =&gt; 'value_field_file_two',
        'field_two' =&gt; 'value_field_file_two'
      ), 
    );
    $row-&gt;your_file_uri_source_array = array('file_one_uri', 'file_two_uri');
  }