Migrate drupal 7 to 8 - node w/ body, terms and files

You'll need to set up a copy of the d7 database and files before starting. I ran drush migrate-upgrade to load the config, then exported it and moved it into a custom module where I can tweak it. Check out migrate_upgrade and config_devel to learn more about that process.

The tricky part about this is understanding how to use the sub_process, migration_lookup, and static_map process plugins.

First up is the body. It's a multi value field, so needs to have the field values set up with a sub process.

body:
  plugin: sub_process
  source: body
  process:
    value:
      plugin: get
      source: value
    format:
      plugin: default_value
      default_value: full_html


Next is the taxonomy field. I created the taxonomy and terms in the new system manually and used a static map to connect the term ids.

field_department:
  plugin: static_map
  source: field_department
  map:
    3280: 81
    3300: 86
    3301: 91
    3302: 96
    3303: 101

Lastly, the files. This depends on the files migration created by migrate-upgrade.

field_image:
  plugin: migration_lookup
  migration: migrate_files
  source: field_image1/0/fid
Tags
Migration