0

In the Drupal 7 migrate module, you can use 'csvrownum' as the mapping key when migrating content from a CSV (https://www.drupal.org/node/1152158). For the Drupal 8 version, I am not sure what the equivalent is. Here is my yml file configuration (migrate plus):

id: timesheet_data
label: Importing Timesheet
migration_group: csvimport
migration_tags:
  - node
  - csvimport
source:
  plugin: csv
  path: 'somepath/timesheet.csv'
  header_row_count: 1
  keys:
    - csvrownum
  column_names:
    0:
      name: Name of Contact
    1:
      address: Address
destination:
  plugin: 'entity:node'
  default_bundle: timesheets
process:
  title: name

I tried this approach thinking it might be similar to the drupal 7 migrate module. I also tried not specifying a key, both resulted in an error.

0

I couldn't find a way to do this, but I found out you can specify multiple keys to make the row more unique for mapping.

keys:
- name
- address

When I applied more keys as a mapping, all the records imported since it was more unique.

Hopefully this helps someone else.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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