0

I'm trying to migrate a multi-value D6 image field to D8. I've already migrated the files with d6_file and it worked. When I do the node migration with the image field works and I get all the values but the alt and title text are not migrated.

  field_image:
    plugin: sub_process
    source: field_image
    process:
      target_id:
        plugin: migration_lookup
        migration: upgrade_d6_file
        source: fid
      alt: alt
      title: title
0

So this worked for me not sure why. But my file migration id was upgrade_d6_file and when I change this in line 54 of Drupal\file\Plugin\migrate\process\d6\FieldFile and ran the migration with the settings below I got the correctly referenced files and the alt/title text.

Diff

  // Configure the migration process plugin to look up migrated IDs from
  // a d6 file migration.
  $migration_plugin_configuration = $configuration + [
-   'migration' => 'd6_file',
+   'migration' => 'upgrade_d6_file',
    'source' => ['fid'],
  ];

Migrate yml

field_primary_image:
    plugin: d6_field_file
    source: field_image
    process:
      target_id:
        plugin: migration_lookup
        migration: upgrade_d6_file
        source: fid
      alt: alt
      title: title

Or even better is write your own process plugin like this: https://github.com/mikeryan776/d8-migrate-example-001/blob/master/migrate_carlyle/src/Plugin/migrate/process/CarlyleCckFile.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.