3

I am migrating a Drupal 7 site to Drupal 8 using the Migrate API. So far, I have been able to do this without writing my own plugins.

How do I migrate additional information in an image field (e.g. the alt and title attributes)?

So far I have been using this, but it does not seem to work.

field_bild:
  plugin: iterator
  source: field_bild
  process:
    target_id:
      plugin: migration
      migration: d7_file
      source: fid
      alt: alt
      title: title
2

Here is the format I found working:

field_teaser_image/target_id:
  plugin: migration
  migration: attachment_image
  source: file_id
field_teaser_image/alt: file_alt
1

Here is the correct format for 8.2 and up.

  field_bild:
    plugin: iterator
    source: field_bild
    process:
      target_id: fid
      alt: alt
      title: title
      width: width
      height: height
  • I think this might be a valuable answer, but could you please elaborate how to use this with the migration process plugin? – Ambidex Jun 29 '17 at 11:48
  • I'm little confused @Ambidex, the process plugin being used is the iterator – heshanlk Aug 31 '17 at 16:11

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.