migrate_plus.migration.mig_article_media_step1.yml in Migrate File Entities to Media Entities 8
migrate_file_to_media_d7_d8/config/install/migrate_plus.migration.mig_article_media_step1.yml
File
migrate_file_to_media_d7_d8/config/install/migrate_plus.migration.mig_article_media_step1.ymlView source
- # File to Media Migration configuration for Article Media migration
-
- id: mig_article_media_step1
- label: Article Media Step 1
-
- source:
- key: migration_source_db
- # Adapt it to your language
- langcode: und
- plugin: media_entity_generator_d7
- entity_type: node
- bundle: article
- d7_file_url: 'http://<d7-domain.tld>/sites/default/files/'
- field_names:
- - field_image
- # Using default language code unless other specified.
- langcode: 'und'
-
- destination:
- plugin: entity:media
-
- process:
- bundle:
- plugin: default_value
- default_value: image
-
- # Using the alt tag if available, else the file name.
- name:
- plugin: media_name
- source: file_name
-
- # This process plugin will skip the whole row if a existing media is found.
- existing_media_file:
- plugin: check_media_duplicate
- source: target_id
-
- # This process plugin will skip the whole row if a duplicate image is found.
- unique_file_id:
- plugin: check_duplicate
- source: target_id
-
- # Map the field image
- field_media_image/alt: alt
- field_media_image/title: title
- field_media_image/target_id:
- plugin: media_file_copy
- move: FALSE
- reuse: TRUE
- path: 'public://media/article/'
- source: file_path
-
- langcode: langcode
-
- uid:
- plugin: default_value
- default_value: 1