-1

has the following value:
  1. Firma
  2. Landwirtschaft
  3. Auto
  4. Stadt
  5. Traktor
  6. Straße
  7. Wald
  8. Wiese
  9. Park
  10. Felder

The 10 values should be imported into Drupal, version 8.
In order not to have to read out these 10 terms from the database, I would like to "write these values into a YML import file" and import them that way.
How can you do that?

Here is the first draft of the YML file:

id: k1_import
label: 'Daten import'
migration_group: k1_migration
source:
  plugin: k1import
  key: migration_k1
process:
  title: Firma
  title: Auto
…
1
  • What's not working here? What are you confused about? The migrate_plus module has a lot of migration examples.
    – sonfd
    Jul 25 '20 at 11:54
0

got a tip from a friend, here are the links:

https://api.drupal.org/api/drupal/core%21modules%21migrate%21src%21Plugin%21migrate%21source%21EmbeddedDataSource.php/class/EmbeddedDataSource/9.0.x

https://www.drupal.org/docs/8/api/migrate-api/migrate-destination-plugins-examples/migrating-users

Here's my solution, in a nutshell, begin of the YML file:

id: k1_import
label: 'Daten import'
migration_group: k1_migration
source:
  plugin: embedded_data
  data_rows:
    - 
        name_id: 1
        name: Firma
    -
        name_id: 2
        name: Landwirtschaft
    -
        name_id: 3
        name: Auto
    -
        name_id: 4
        name: Stadt
   ids:
     name:
          type: string
process:
    name: name
destination:
  plugin: 'entity:taxonomy_term'
  default_bundle: daten_import

End of the YML file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.