I'm using Migrate Tools, Migrate Plus and Migrate Source CSV. My CSV file looks like that:

"user2";"black";"rotten banana"

I'm using the Profile Module (https://www.drupal.org/project/profile)

I have a migration within my migration group that looks like this (migrate_plus.migration.user_vorlesungen.yml):

id: user_vorlesungen
langcode: de
status: true
            - user_migrate
migration_group: hoevwa
label: 'HoeVWA Vorlesungen Import'
    plugin: csv
    track_changes: true
    path: /config/Vorlesungsverzeichnis.csv
    # Column delimiter. Comma (,) by default.
    delimiter: ';'
    # Field enclosure. Double quotation marks (") by default.
    enclosure: '"'
    header_row_count: 1
        - Stg
    plugin: entity:profile
        plugin: default_value
        default_value: 'vorlesungen'
        plugin: migration_lookup
        no_stub: true
        # previous user migration
        migration: user__hoerer
        # property in the source data
        source: Stg
    # These field have multiple values in D8
    field_color: Color
    field_fruit: Fruit

    required: {  }
    optional: {  }

In my YAML file the content is printed like that:

    <td>{{ content.field_color }}</td>
    <td>{{ content.field_fruit }}</td>

When I run drush mim --group=hoevwa only the last values of user1 (blue, pear) are imported. How can I get running a process plugin to loop through the CSV and get all values imported. And finally how can I loop through all values in my TWIG Template?

1 Answer 1


The solution will be to create a custom Migration Source Plugin and do some magic in the fetchNextRow() method. Depending on the source of your data, you might also use some other approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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