I'm using the migrate module to migrate content from a D6 site.
The D6 site used the image module, with image_gallery.
I can create Gallery nodes [terms in the D6 site].
I can create Media items [image nodes in the D6 site] using MigrateDestinationFile.

What I can't do is wire them together.
It would appear that media items are stored as a reference on the Gallery node.
So I should be able to map that.
I can get a comma separated list of file ids, [or what was their Node ids before import],
so passing that in like this should work

    // $media_list looks like this
   // $query->addExpression('GROUP_CONCAT(n.nid)', 'media_list');
    //$media_list = "234,456,789";
    // Pass in the list if images
    $this->addFieldMapping('media_gallery_media', 'media_list')
         ->arguments(array('source_type' => 'fid'))

but it doesn't.
Any clues?


alanburke’s picture

Project:Media Gallery» Migrate
Version:7.x-1.x-dev» 7.x-2.x-dev

Maybe somebody on the Migrate module side might be able to shed some light?
I can create Media Gallery nodes and Media items but I'm trying to tie them together with no luck.
The Media items are migrated first, then the Media Gallery nodes.
The code above is in the field mapping for the media gallery node.

StuartDH’s picture

Hi Alan, I hope I'm not sending you off on the wrong path, but have you tried the Migrate Extras module? http://drupal.org/project/migrate_extras

I've not used it yet, but I think it might be of use to you

mikeryan’s picture

Project:Migrate» Migrate Extras
Component:Code» Media

Contrib module support goes in Migrate Extras, not Migrate.

mikeryan’s picture

Title:Migrating content using media module» Support for Media Gallery
mikeryan’s picture

Category:support» feature