Skip to content

Instantly share code, notes, and snippets.

@rakeshjames
Last active June 22, 2018 09:21
Show Gist options
  • Save rakeshjames/2230cc84776f87fca702db4c1d1f5aea to your computer and use it in GitHub Desktop.
Save rakeshjames/2230cc84776f87fca702db4c1d1f5aea to your computer and use it in GitHub Desktop.
id: migrate_csv_articles
label: 'Migrate articles from the csv file'
source:
plugin: csv
# Full path to the file.
path: 'modules/custom/migrate_csv/assets/csv/articles.csv'
delimiter: ','
enclosure: '"'
header_row_count: 1
keys:
- ID
process:
# Adding the mapping between the fields and the csv columns.
title: Title
body: Body
type:
plugin: default_value
default_value: article
field_tags:
-
plugin: explode
delimiter: ', '
source: Tags
-
plugin: migration
migration: migrate_csv_tags
'field_image/target_id':
plugin: migration
migration: migrate_csv_articles_images
source: Picture
uid:
-
plugin: author_id
source: Author
destination:
plugin: entity:node
migration_dependencies:
optional:
- migrate_csv_articles_images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment