Skip to content

Instantly share code, notes, and snippets.

@delta-9
Last active February 23, 2016 15:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delta-9/8ab021086704dbaeef0c to your computer and use it in GitHub Desktop.
Save delta-9/8ab021086704dbaeef0c to your computer and use it in GitHub Desktop.
id: example_content
label: Example content
migration_group: example
source:
plugin: example_content
target: db_migration
destination:
plugin: entity:node
process:
type:
plugin: default_value
default_value: article
title: title
uid:
plugin: default_value
default_value: 1
changed:
plugin: example_date
source: updated_at
created:
plugin: example_date
source: created_at
sticky:
plugin: default_value
default_value: 0
status:
plugin: default_value
default_value: 0
'body/value': content
'body/summary': excerpt
'body/format':
plugin: default_value
default_value: full_html
# Use of the migration process plugin.
# That will use the id map of the specified migration
# to retrieve the corresponding id ('source' parameter) in the destination database.
field_image:
plugin: migration
migration: example_file
source: image_id
# Here its a multivalued fields we just pass an array of source ids. Nothing different,
# the transform() method wil be called on each value.
field_attached_files:
plugin: migration
migration: example_file
source: file_ids
# And the category, difference here is that the unique id is a string (the name of the category).
field_category:
plugin: migration
migration: example_category
source: category
# We define the migration that need to run first.
migration_dependencies:
required:
- example_file
- example_category
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment