Skip to content

Instantly share code, notes, and snippets.

@mohit-rocks
Last active February 14, 2018 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohit-rocks/ba3b1003cc88ff077f4ad466c46e40da to your computer and use it in GitHub Desktop.
Save mohit-rocks/ba3b1003cc88ff077f4ad466c46e40da to your computer and use it in GitHub Desktop.
Migration template : Specify custom ID Map Plugin (Drupal 8)
id: node_page
label: "Page Content"
migration_tags:
- content_import
# Notice ID Map plugin here.
idMap:
plugin: content_update
# ID Map plguin declaration ends.
source:
plugin: csv
path: 'public://example.csv'
header_row_count: 1
keys:
- 'Item-ID'
fields:
Item-ID: Unique identifier for each page.
Page name: Name of the page.
Page category: Page category.
process:
type:
plugin: default_value
default_value: page
title: Page name
langcode:
plugin: default_value
default_value: "en"
field_page_category:
-
plugin: skip_on_empty
method: row
source: Page category
message: "Row skipped due to empty Page category"
field_page_unique_id:
-
plugin: skip_on_empty
method: row
source: Item-ID
message: "Row skipped due to empty Item-ID value"
destination:
plugin: entity:node
translations: true
migration_dependencies:
required: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment