Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The one missing piece now to the beer example is a demonstration of image migration. Since this will be the first introduction to D8 migration development for many, it's important to start off with best practices, so unlike the D7 version we'll show how to migrate files in a separate migration, referenced by the node migration.
Comments
Comment #2
charginghawk CreditAttribution: charginghawk at Genuine commentedmikeryan - while waiting for this issue to be resolved, can you quickly describe what best practices should be for image migration?
I'm working with image migration right now, and even a brief outline of the procedure would be very helpful in the interim.
Comment #3
mikeryanBest practice in general is to migrate file assets in their own migration and reference them (with the migration process plugin) from any other entity that needs them. To my mind, creating entities as side-effects of migrations rather than explicitly in their own migration is problematic on multiple counts
Comment #4
ressa CreditAttribution: ressa as a volunteer commentedHas an example been included yet in the beer example?
Comment #5
mikeryanNo, this issue is still open.
Comment #6
mikeryanActually, let's wait until #2695297: Refactor EntityFile and use process plugins instead is done, and add this in the 8.2.x-compatible branch of migrate_plus once that's opened.
Comment #7
mikeryanComment #8
moshe weitzman CreditAttribution: moshe weitzman at Acquia commentedComment #9
youfei.sun CreditAttribution: youfei.sun commentedAny updates on this issue please?
Comment #10
ressa CreditAttribution: ressa as a volunteer commentedIt would be really great with a working example of how to import an image. There is part of an example in #2635622: Process plugin for importing/creating files by URL, but I can't quite figure out how to piece it all together...
Comment #11
mikeryanThe EntityFile patch is in core 8.2.x, so we'll be able to address this once I open the 8.x-3.x branch supporting 8.2.x and up.
Comment #12
ressa CreditAttribution: ressa as a volunteer commentedFantastic, I look forward to that release, thanks!
Comment #13
nicrodgersDoes anyone have any working config/code examples for migrating an image in to 8.2.x? I can't seem to find anything :(
Comment #14
maijs CreditAttribution: maijs as a volunteer and at Wunder commented@nicrodgers, try migrate_source_example module (8.2.x branch). Take a look at migration example from CSV files, it has been updated to work with Drupal 8.2.
Comment #15
youfei.sun CreditAttribution: youfei.sun commentedI think #14 is not helping, any hints on that?
p.s. looking at those files, i did have step through a bit, but I can't make the file_copy plugin right or there is some other issues,
all my attempts for migrating a single file entity failed with no detailed information, a clear beer example for migrating file entity would be optimal
Comment #16
youfei.sun CreditAttribution: youfei.sun commentedFrom #6 , what I get is that from drupal 8.2.x we can use something like
for an file entity, but this did not work in my case, did I miss anything in that thread?
Comment #17
Summit CreditAttribution: Summit commentedHi, any progress in adding image example please?
Greetings,