I am following the instruction on this page : https://www.drupal.org/project/migrate_file_to_media/issues/3118471 , but with media of bundle document, not image. I have my step 1 yml on this issue How can i debug why files are not being created when using migrate files to media module? My nodes of type grants and step 1 files are being created as media correctly, however when i do step 2, using the yml below, I get this error :
Missing bundle for entity type node (/var/www/html/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:108)
id: migd8_grants_media_step2
label: grants Media Mapping
migration_group: cncs
source:
key: migrate
plugin: d7_node
node_type: grants
destination:
plugin: entity:node
process:
nid: nid
changed: changed
field_files:
plugin: file_id_lookup
source: field_files
migration: migd8_grants_media_step1
no_stub: true
migration_dependencies:
optional:
- migd8_node_grants
- migd8_grants_media_step1
I made some changes as an experiment and started getting duplicate grants being created, one with the correct media files attached, and one without , these are the changes i made which caused the duplicates with one having the correct file attached:
id: migd8_grants_media_step2
label: grants Media Mapping
migration_group: cncs
source:
key: migrate
plugin: d7_node
node_type: grants
destination:
plugin: entity:node
process:
nid: nid
changed: changed
title: title
type:
plugin: default_value
default_value: grants
field_files:
plugin: file_id_lookup
source: field_files
migration: migd8_grants_media_step1
no_stub: true
migration_dependencies:
optional:
- migd8_node_grants
- migd8_grants_media_step1