I have a site with several different Node Types. With some of them having different types within them created with a Text(list) fields.
For Example:
Node Content Type: Chemicals
Label: Chemical Type Machine Name: field_chemical_type Field type: List (text)
Allowed Values list:
fertilizer|Fertilizer
fungicide|Fungicide
herbicide|Herbicide
insecticide|Insecticide
surfactant|Surfactant
indicator|Indicator
We would like to convert these to a new ECK Content type with separate bundles for each of the Allowed Values. Of which, we have already created them and the bundle types correspond to the "key" values within the Allowed values list.
Is there a way to migrate the entire content type and have the bundles change according to the value designated in the field_chemical_type list?
I have tried the following and it is not working for me:
langcode: en
status: true
dependencies: { }
id: seward7_chemical_nodes
class: Drupal\node\Plugin\migrate\D7NodeTranslation
field_plugin_method: null
cck_plugin_method: null
migration_tags:
- 'Drupal 7'
- Content
migration_group: sew7
label: 'Chemical Nodes'
source:
plugin: d7_node
node_type: chemicals
process:
id:
-
plugin: get
source: nid
type:
-
plugin: get
source: field_chemical_type
langcode:
-
plugin: default_value
source: language
default_value: und
title:
-
plugin: get
source: title
created:
-
plugin: get
source: created
changed:
-
plugin: get
source: timestamp
field_name:
-
plugin: get
source: field_chemical_name
destination:
plugin: 'entity:chemical'
migration_dependencies:
required:
- seward7users
optional: []
I have read contradicting info on "default_bundle" in the destination. So I am confused. One post says you have to designate a default_bundle another states you don't if you stipulate it in the "type" within the Process side of things.
If I can designate it in the Process, am I using the wrong plugin?
We have several other Node Content Types that we would like to convert into their own entities with separate bundles. So it would be extremely beneficial not to have to create separate yml files for every bundle within the individual entity types.
I am a site builder with a enough coding experience to get myself in trouble. But I want to learn. Any advice or guidance on where to go to learn would be greatly appreciated!