I installed the module wiped all the data and reran the import however I am not getting anything in the media tab on D8.7 Alpha 2 nor is it changing my content type fields. Am I missing something?
Thanks in advance.
I installed the module wiped all the data and reran the import however I am not getting anything in the media tab on D8.7 Alpha 2 nor is it changing my content type fields. Am I missing something?
Thanks in advance.
Comments
Comment #2
juampynr commentedHi @Christopher Riley!
Can you paste here the exact commands that you used to do the above?
Comment #3
Christopher Riley commentedFirst I ran:
drush mim --group=migrate_drupal_7 --tag=Configuration --execute-dependencies --feedback=1
Then I ran:
drush mim --group=migrate_drupal_7 --tag=Content --execute-dependencies --feedback=1
Each content type at the least has a field_image on it which at the least I would think would have been seen and done. Files tab does show all the files and those images did attach to the image fields correctly but nothing shows in the media tab nor does the content type have either a change to the image field (still says image and not a media reference) nor is there a media field created.
Suggestions and thanks in advance.
Comment #4
juampynr commentedSure, I think that you should start by rolling back the d7_field_instance and d7_field migrations. Then run them again and check that:
a) Entity reference fields in nodes or taxonomies in 7 pointing to images should be transformed to image media fields in 8.
b) If there are matching media bundles in 8 (like document or image), then the fields that the Drupal 7 media bundles have should be created in 8. Notice that there is a README in this module with instructions on how to configure non-core media bundles so their fields and content get migrated too.
Try that and let me know how it goes.
Comment #6
juampynr commented@Christopher Riley: I just realized that the content migrations did not have the Content tag. Therefore,
drush mim --group=migrate_drupal_7 --tag=Content --execute-dependencies --feedback=1would not migrate media as you would expect. Try updating the module, regenerating migrations, and run them again.Comment #7
Christopher Riley commentedCloser much closer this time. I am able to see my images within the media tab now however I do not see any other media types although I have a ton of pdf files and a single local video and a few remote videos. Another question I have is I thought that within the content types that the fields would shift to a entity reference and not be a image field anymore. Am I mistaken on this and if so does anyone have any pointers on doing a conversion to a entity reference?
Comment #8
juampynr commentedFor the PDF files, are they of type document or file? You may need to tweak media_migration.module. See #3044379: Migrate Drupal 7 document media to Drupal 8.8+ document media type for details.
As per the fields, that's odd because image fileds should be migrated into entity reference fields which point to an image media entity. Can you try:
a) running again (rollback and then migrate) the d7_field and d7_field_instance migrations.
b) migrate all files by running the d7_file migration. Then check an image field to see that it has been migrated as an entity reference fields which point to an image media entity.
c) migrate content and media.
Comment #10
juampynr commentedI just pushed code to transform image fields to image media fields. Marking as fixed.
@Christopher Riley: If you find issues, please create a new one. Thanks for the feedback!
Comment #11
juampynr commentedComment #13
drupalfan2 commentedI still have the same problem:
Files from D7 site are imported as files to my D8 site, NOT imported as media entities. I have tried it a lot of times and I followed the instructions above.
But it does not work! No imported media entity, only imported files as a result.
See also here.
How can I solve this?
Comment #14
nixou commentedIt is normal that D7 files are migrated to files on D8 / D9 and not to media.
On D8 / D9 there are always files and media (media references files).
If you want to get media on D8 when you only had files on D7, you have to proceed in two steps:
1. Migrate D7 files to D8 files
2. Migrate D7 files to D8 media and automatically reference the files created in point 1
So you need to have 2 migration files.
The first file should use the source plugin "d7_file" and the destination plugin "entity:file".
The second file should use the source plugin "d7_file_entity_item" and the destination plugin "entity:media".
In the second file you can attach automatically your new media to the associated file using the process plugin "migration_lookup".
Currently the patch in this issue is not needed to do this and this patch causes problem (see #3160698).