Update July 2020:
This has seemingly been hammered out but you may need to make further adjustments in your import YML files.

For Alt text See also:

The inline assets are not rewritten (that is when you import an image it is still pointing offsite, however the images are loaded into the file attachments locally). See #2742279: Rewrite local link/image references in content, switch image content domains


Earlier: Because the core file migration support is being refactored and will require significant changes to the attachment migration, I'm postponing implementing that for now.

Comments

mikeryan created an issue. See original summary.

mikeryan’s picture

mikeryan’s picture

Status: Postponed » Active
Trav84’s picture

Is there any update/progress on this? It looks as if the core issue this was waiting on has been resolved, just wondering if this is still in the works.

ipa 🍺’s picture

I'm interested to, any news on this one?

ipa 🍺’s picture

Here is a patch that will import all Wordpress attachments and assigns the "Featured images" to a selected image field in Drupal.

Things still to do:
- Alt texts migrations
- Rewrite links/images sources in texts. @see: https://www.drupal.org/node/2742279

To make the process tab in the UI working with the attachments migration you need this patch for the migrate_tools module: https://www.drupal.org/files/issues/process_interface_warning_error_mult...

hongpong’s picture

Status: Active » Needs review

Thank you for looking into this!!

anruether’s picture

Can you give me an idea what is needed to integrate alt text?
Otherwise I am able to migrate the image with the patch in #6:

  field_image/target_id:
    -
      plugin: migration_lookup
      migration: wordpress_attachments
      no_stub: true
      source: thumbnail_id
damienmckenna’s picture

Just to mention it, I'm using the patch above with the latest -dev codebase and it appears to be working on a custom migration, I just needed to update my customized yml file accordingly (basically recreating it from the latest version). Good work!

caspervoogt’s picture

#6 is working great for me

gmangones’s picture

Hello, I apply this path, the content import super, the image is placed in image_feature/*, but in content type the field_image is not uploaded or saved the image. How is work?

Thanks

hongpong’s picture

StatusFileSize
new6.67 KB

Re-roll from current head. Patch attached.

Also on new file ImageSelectForm.php this should be a dependency injection:

    // @todo this should be dependency injection.
    $field_map = \Drupal::service('entity_field.manager')->getFieldMap();

@gmangones you should run the image import before running the content import. That seems to work correctly.

hongpong’s picture

  • HongPong committed 10d0b56 on 8.x-3.x authored by e.ruiter
    Issue #2742269 by HongPong, e.ruiter, mikeryan, DamienMcKenna,...
hongpong’s picture

Status: Needs review » Fixed

Thank you everyone!!!

I have updated the Readme to address that this does not change the inline file references (that is the body links to images are not updated). Featured images should be OK.

Next related issues:

If people have problems with this process please open a new issue with enough information to reproduce it, or comment on the appropriate existing issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

oknaru’s picture

I am having same issue as per #11, any help is much appreciated

hongpong’s picture

Hello oknaru,

I have posted a new version alpha6 with ctools v4 and migrate_plus v6, can you give that a try? If the issue recurs please file a new issue.