content migration to drupal 8

14
Content Migration to D8

Upload: drupal-camp-delhi

Post on 14-Apr-2017

129 views

Category:

Internet


1 download

TRANSCRIPT

Page 1: Content Migration to Drupal 8

Content Migration to D8

Page 3: Content Migration to Drupal 8

Agenda

- Basics of Migration Configuration Entity (YML)

- Basics of how to write Source and Process Plugins

- Demo code to showcase migrations from Drupal / XML / JSON / Custom Mysql database

- Exercise to do migration from a given source (xml, json, mysql db)

Page 4: Content Migration to Drupal 8

Migration Configuration Entity (YML)

Heart of the migration is YML file. YML has four important keys,

- Id

- Source

- Process

- Destination

Page 5: Content Migration to Drupal 8

Sample YML File

Page 6: Content Migration to Drupal 8

Sample YML File - XML/JSON

Page 7: Content Migration to Drupal 8

Core/Contrib Process Plugins

https://www.drupal.org/docs/8/api/migrate-api/migrate-process

- get

- callback

- default_value

- concat

- migrate

Page 8: Content Migration to Drupal 8

Core/Contrib Source Plugins

- XML

- JSON

- SOAP

Page 9: Content Migration to Drupal 8

Custom Process Plugin

Page 10: Content Migration to Drupal 8

Custom Source Plugin - SQL

Page 11: Content Migration to Drupal 8

Migration related Drush Commands

drush migrate-status (ms)

drush migrate-import <migration-name> (mi) [--update, --idlist=1,2,4]

drush migrate-rollback <migration-name> (mr)

drush migrate-reset-status <migration-name> (mrs)

Page 13: Content Migration to Drupal 8

Exercise Time

- Users

- eyeColor (taxonomy), gender (select list - m/f), about (split in 2 fields), registered (timestamp)

- Data

- money (prefix $), user_id (map to user),

Page 14: Content Migration to Drupal 8

References

- Writing D6 to D8 entity migrations

- Drupal 6 to Drupal 8(.1.x) Custom Content Migration