Migrate 140123161042-phpapp02
-
Upload
gaurav-varshney -
Category
Technology
-
view
87 -
download
1
description
Transcript of Migrate 140123161042-phpapp02
![Page 1: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/1.jpg)
migrating to drupal 8
![Page 2: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/2.jpg)
a brief historydrupal.org/upgrade
![Page 3: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/3.jpg)
update vs. upgradewhat types drupal “renewing” we have?
![Page 4: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/4.jpg)
drupal update
![Page 5: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/5.jpg)
drupal update minor version update
7.24 > 7.25
![Page 6: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/6.jpg)
drupal upgrade
drupal update minor version update
7.24 > 7.25
![Page 7: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/7.jpg)
drupal upgrade
drupal update minor version update
7.24 > 7.25
major version upgrade7.x > 8.x
![Page 8: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/8.jpg)
drupal upgrade
drupal update minor version update
7.24 > 7.25
major version upgrade7.x > 8.x
![Page 9: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/9.jpg)
the migrate module“in service” since 2009
drupal.org/project/migrate
![Page 10: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/10.jpg)
the migrate module
• How it worked?
• Migrations = classes extending Migration.
• Main elements: source, destination, map, mappings, “hooks” (prepareRow, prepare, complete, createStub, etc).
• Each migration has to extend the Migration class or one of its successors.
![Page 11: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/11.jpg)
![Page 12: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/12.jpg)
migrate in D8 core
![Page 13: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/13.jpg)
disclaimer
![Page 14: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/14.jpg)
disclaimer
• the migrate system is under heavy development right now.
![Page 15: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/15.jpg)
disclaimer
• the migrate system is under heavy development right now.
• some of the features or APIs may change in the future
![Page 16: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/16.jpg)
disclaimer
• the migrate system is under heavy development right now.
• some of the features or APIs may change in the future
• not all the current work is pushed to 8.x.
![Page 17: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/17.jpg)
disclaimer
• the migrate system is under heavy development right now.
• some of the features or APIs may change in the future
• not all the current work is pushed to 8.x.
• The work is in the sandbox athttps://drupal.org/sandbox/chx/2105305
![Page 18: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/18.jpg)
creditsKároly Négyesi (chx)Mike Ryan (mikeryan)
Moshe Weitzman (moshe weitzman)Ben Dougherty (benjy)
![Page 19: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/19.jpg)
drupal 8 migration
![Page 20: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/20.jpg)
note
![Page 21: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/21.jpg)
note
• While a significant portion of the code and the interaction between the elements is brand new, the actual migrate-y code is coming straight from D7: highwater marks, track changes, id map, this is here to
![Page 22: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/22.jpg)
note
• While a significant portion of the code and the interaction between the elements is brand new, the actual migrate-y code is coming straight from D7: highwater marks, track changes, id map, this is here to
• The new interaction allows for really nice and powerful migrations but at the same time we are most definitely not reinventing wheel.
![Page 23: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/23.jpg)
structure/modules
![Page 24: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/24.jpg)
Migratecore/modules/migrate/
![Page 25: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/25.jpg)
Migratecore/modules/migrate/
• provides general API for all migrations
![Page 26: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/26.jpg)
Migratecore/modules/migrate/
• provides general API for all migrations
• provides interfaces and base classes for all migration plugin components (source, destination, process, id_map, row).
![Page 27: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/27.jpg)
Migratecore/modules/migrate/
• provides general API for all migrations
• provides interfaces and base classes for all migration plugin components (source, destination, process, id_map, row).
• provides a plugin manager for manipulation on migration plugins.
![Page 28: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/28.jpg)
Migratecore/modules/migrate/
• provides general API for all migrations
• provides interfaces and base classes for all migration plugin components (source, destination, process, id_map, row).
• provides a plugin manager for manipulation on migration plugins.
• provides the migrate configurable (configuration entity type).
![Page 29: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/29.jpg)
Migrate Drupalcore/modules/migrate_drupal/
![Page 30: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/30.jpg)
Migrate Drupalcore/modules/migrate_drupal/
• the first module using the new Migrate API.
![Page 31: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/31.jpg)
Migrate Drupalcore/modules/migrate_drupal/
• the first module using the new Migrate API.
• kind of migrate_d2d successor.
![Page 32: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/32.jpg)
Migrate Drupalcore/modules/migrate_drupal/
• the first module using the new Migrate API.
• kind of migrate_d2d successor.
•migrates out-of-the-box from Drupal 6 and 7 into Drupal 8.
![Page 33: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/33.jpg)
Migrate Drupalcore/modules/migrate_drupal/
• the first module using the new Migrate API.
• kind of migrate_d2d successor.
•migrates out-of-the-box from Drupal 6 and 7 into Drupal 8.
•Defines migrations for all system components:
![Page 34: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/34.jpg)
Migrate Drupalcore/modules/migrate_drupal/
• the first module using the new Migrate API.
• kind of migrate_d2d successor.
•migrates out-of-the-box from Drupal 6 and 7 into Drupal 8.
•Defines migrations for all system components:
•Drupal 6 settings (site name, slogan, roles, etc)
![Page 35: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/35.jpg)
Migrate Drupalcore/modules/migrate_drupal/
• the first module using the new Migrate API.
• kind of migrate_d2d successor.
•migrates out-of-the-box from Drupal 6 and 7 into Drupal 8.
•Defines migrations for all system components:
•Drupal 6 settings (site name, slogan, roles, etc)
•Content definitions (vocabularies, node types, etc)
![Page 36: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/36.jpg)
Migrate Drupalcore/modules/migrate_drupal/
• the first module using the new Migrate API.
• kind of migrate_d2d successor.
•migrates out-of-the-box from Drupal 6 and 7 into Drupal 8.
•Defines migrations for all system components:
•Drupal 6 settings (site name, slogan, roles, etc)
•Content definitions (vocabularies, node types, etc)
•Content (noded, terms, users, etc).
![Page 37: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/37.jpg)
understanding migrations
![Page 38: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/38.jpg)
migrations are configurables
![Page 39: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/39.jpg)
small peekinto configurables
![Page 40: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/40.jpg)
what is a configurable?
![Page 41: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/41.jpg)
• “Configurables” are configuration entities.
what is a configurable?
![Page 42: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/42.jpg)
• “Configurables” are configuration entities.
• In Drupal 8 the content is separated from configuration. Both are classes and are sharing the same ancestor: the Entity class.
what is a configurable?
![Page 43: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/43.jpg)
• “Configurables” are configuration entities.
• In Drupal 8 the content is separated from configuration. Both are classes and are sharing the same ancestor: the Entity class.
what is a configurable?
\Drupal\Core\Entity\Entity
![Page 44: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/44.jpg)
• “Configurables” are configuration entities.
• In Drupal 8 the content is separated from configuration. Both are classes and are sharing the same ancestor: the Entity class.
what is a configurable?
\Drupal\Core\Entity\Entity
\Drupal\Core\Entity\ContentEntityBase
![Page 45: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/45.jpg)
• “Configurables” are configuration entities.
• In Drupal 8 the content is separated from configuration. Both are classes and are sharing the same ancestor: the Entity class.
what is a configurable?
\Drupal\Core\Entity\Entity
\Drupal\Core\Entity\ContentEntityBase
\Drupal\Core\Config\ConfigEntityBase
![Page 46: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/46.jpg)
• “Configurables” are configuration entities.
• In Drupal 8 the content is separated from configuration. Both are classes and are sharing the same ancestor: the Entity class.
what is a configurable?
\Drupal\Core\Entity\Entity
\Drupal\Core\Entity\ContentEntityBase
\Drupal\Core\Config\ConfigEntityBase
![Page 47: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/47.jpg)
• A configurable is the way Drupal 8 stores the configuration of a specific functionality. E.g. the the definition of a node type is stored in a configuration entity of type “node_type”.
• Configuration entity types are annotated classes, meaning that the object meta information is stored in annotation rather than in info hooks - as it was in Drupal <= 7.
• Imagine configurables as entities storing their data in config YAML files rather than DB.
• The “fields” of a configurable are the public properties exposed by the configurable object.
what is a configurable?
![Page 48: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/48.jpg)
what is a configurable?
![Page 49: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/49.jpg)
how it’s stored?example
![Page 50: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/50.jpg)
migration pluginsparts implemented by specific migrations
![Page 51: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/51.jpg)
source plugins
• plugins returning information and data from the source of migration.
• usually: the list of fields, the source iterator (used retrieve data from source).
• each migration should configure a source.
![Page 52: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/52.jpg)
destination plugins
• are handling data at the destination: import, rollback.
• different plugins for different destination components: entity, config, etc.
• are defined in the base module (migrate) as destination is always drupal 8 but if necessary it can be extended.
• each migration should specify a destination.
![Page 53: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/53.jpg)
id map plugin
• plugins of this type are handling and storing the relation between primary IDs of source and destination.
• without this, rollback and continuous migrations are impossible.
• in 99% of the cases you’ll use the sql id map plugin (Sql) that keeps the map of each migration in a table.
• table name migrate_map_MIGRATION_ID
![Page 54: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/54.jpg)
processors
• plugins that are performing small but very specialized operations against values to be migrated.
• Some simple examples: DefaultValue, Concat, etc.
• The most important interface method: transform().
![Page 55: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/55.jpg)
the anatomy of a migrationmigrating user roles from a dupal 6 site
![Page 56: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/56.jpg)
creating the config fileconfig/migrate.migration.d6_user_role.yml
relative to core/modules/migrate_drupal
![Page 57: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/57.jpg)
config .yml file content
![Page 58: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/58.jpg)
config .yml file content• id: same as the last part of filename (d6_user_role)
![Page 59: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/59.jpg)
config .yml file content• id: same as the last part of filename (d6_user_role)
• sourceIds: Source fields, providing a primary ID.
![Page 60: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/60.jpg)
config .yml file content• id: same as the last part of filename (d6_user_role)
• sourceIds: Source fields, providing a primary ID.
• source: configure the source of data, usually the source plugin to be used
![Page 61: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/61.jpg)
config .yml file content• id: same as the last part of filename (d6_user_role)
• sourceIds: Source fields, providing a primary ID.
• source: configure the source of data, usually the source plugin to be used
• process: describe the list of processors to be applied per destination field.
![Page 62: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/62.jpg)
config .yml file content• id: same as the last part of filename (d6_user_role)
• sourceIds: Source fields, providing a primary ID.
• source: configure the source of data, usually the source plugin to be used
• process: describe the list of processors to be applied per destination field.
• destination: destination configuration, usually the destination plugin.
![Page 63: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/63.jpg)
id
![Page 64: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/64.jpg)
id• this is the configurable unique id.
![Page 65: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/65.jpg)
id• this is the configurable unique id.
• it must be exactly as the same as the last part of filename: d6_user_role.
![Page 66: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/66.jpg)
id• this is the configurable unique id.
• it must be exactly as the same as the last part of filename: d6_user_role.
id: d6_user_role
![Page 67: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/67.jpg)
sourceIds
![Page 68: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/68.jpg)
sourceIds• look in D6 schema to find the role primary ID.
![Page 69: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/69.jpg)
sourceIds• look in D6 schema to find the role primary ID.
• lines 107 - 115 of drupal/modules/user/user.install.
![Page 70: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/70.jpg)
sourceIds• look in D6 schema to find the role primary ID.
• lines 107 - 115 of drupal/modules/user/user.install.
$schema['role'] = array( 'description' => 'Stores user roles.', 'fields' => array( 'rid' => array( 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'Primary Key: Unique role id.',
![Page 71: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/71.jpg)
sourceIds
![Page 72: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/72.jpg)
sourceIds• use TypedData identifiers for data type.
![Page 73: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/73.jpg)
sourceIds• use TypedData identifiers for data type.
• Here are the .yml lines that we need to add.
![Page 74: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/74.jpg)
sourceIds• use TypedData identifiers for data type.
• Here are the .yml lines that we need to add.
sourceIds: rid: type: integer
![Page 75: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/75.jpg)
sourceIds• use TypedData identifiers for data type.
• Here are the .yml lines that we need to add.
sourceIds: rid: type: integer
Note: sourceIds will be removed in the near future and the source plugin will set also the primary id.
![Page 76: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/76.jpg)
source
![Page 77: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/77.jpg)
source
• we need to implement a source plugin first, that provides the list of fields and the iterator by querying the D6 backend.
![Page 78: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/78.jpg)
source
• we need to implement a source plugin first, that provides the list of fields and the iterator by querying the D6 backend.
• let’s see how it should look (code).
![Page 79: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/79.jpg)
source
• we need to implement a source plugin first, that provides the list of fields and the iterator by querying the D6 backend.
• let’s see how it should look (code).
• add the source plugin id in the configuration .yml file.
![Page 80: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/80.jpg)
source
• we need to implement a source plugin first, that provides the list of fields and the iterator by querying the D6 backend.
• let’s see how it should look (code).
• add the source plugin id in the configuration .yml file.
source: plugin: drupal6_user_role
![Page 81: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/81.jpg)
process
![Page 82: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/82.jpg)
process• process keys are destination “fields”.
![Page 83: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/83.jpg)
process• process keys are destination “fields”.
• for configurables: the public properties (except uuid)
![Page 84: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/84.jpg)
process• process keys are destination “fields”.
• for configurables: the public properties (except uuid)
• for content: the keys from baseFieldDefinitions
![Page 85: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/85.jpg)
process• process keys are destination “fields”.
• for configurables: the public properties (except uuid)
• for content: the keys from baseFieldDefinitions
• let’s see how it looks! (code).
![Page 86: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/86.jpg)
process• process keys are destination “fields”.
• for configurables: the public properties (except uuid)
• for content: the keys from baseFieldDefinitions
• let’s see how it looks! (code).
process: id: label: weight: permissions:
![Page 87: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/87.jpg)
destination
![Page 88: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/88.jpg)
destination
• should point to the destination plugin.
![Page 89: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/89.jpg)
destination
• should point to the destination plugin.
• in this case we’re importing into user_role entity, so we’re passing also the entity_type argument.
![Page 90: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/90.jpg)
destination
• should point to the destination plugin.
• in this case we’re importing into user_role entity, so we’re passing also the entity_type argument.
destination: plugin: entity entity_type: user_role
![Page 91: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/91.jpg)
running a migration
• via drush
• There will be a brief UI implemented in core (to come!)
![Page 92: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/92.jpg)
final notes
![Page 93: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/93.jpg)
final notes• Minor version updates are unchanged. Developers
continue to use hook_update_N() for those.
![Page 94: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/94.jpg)
final notes• Minor version updates are unchanged. Developers
continue to use hook_update_N() for those.
• Contrib and custom modules are encouraged to ship with migrations of their data from D6/D7 to D8. Use core modules as model.
![Page 95: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/95.jpg)
final notes• Minor version updates are unchanged. Developers
continue to use hook_update_N() for those.
• Contrib and custom modules are encouraged to ship with migrations of their data from D6/D7 to D8. Use core modules as model.
• The underlying Migrate API is source-agnostic. You can easily migrate into D8 from MS SQL, Oracle, piles of HTML files, XML feeds, CSV files, etc.
![Page 96: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/96.jpg)
final notes• Minor version updates are unchanged. Developers
continue to use hook_update_N() for those.
• Contrib and custom modules are encouraged to ship with migrations of their data from D6/D7 to D8. Use core modules as model.
• The underlying Migrate API is source-agnostic. You can easily migrate into D8 from MS SQL, Oracle, piles of HTML files, XML feeds, CSV files, etc.
• Similarly, Drupal 4.x and Drupal 5.x sites are able to migrate using this same approach.
![Page 97: Migrate 140123161042-phpapp02](https://reader034.fdocuments.net/reader034/viewer/2022051817/548da015b479597a588b47ac/html5/thumbnails/97.jpg)
Questions?Thank you.