Migrate to Drupal 8

  • Published on
    09-May-2015

  • View
    2.239

  • Download
    1

Embed Size (px)

DESCRIPTION

Migrate is part of the core starting with Drupal 8. This presentation will teach you the anatomy of a migration from Drupal 6 to Drupal 8.

Transcript

<ul><li>1.migrating to drupal 8</li></ul> <p>2. a brief history drupal.org/upgrade 3. update vs. upgrade what types drupal renewing we have? 4. drupal update 5. drupal update minor version update 7.24 &gt; 7.25 6. drupal update minor version update 7.24 &gt; 7.25drupal upgrade 7. drupal update minor version update 7.24 &gt; 7.25drupal upgrade major version upgrade 7.x &gt; 8.x 8. drupal update minor version update 7.24 &gt; 7.25drupal upgrade major version upgrade 7.x &gt; 8.x 9. the migrate module in service since 2009drupal.org/project/migrate 10. 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. 11. migrate in D8 core 12. disclaimer 13. disclaimer the migrate system is under heavy development right now. 14. disclaimer the migrate system is under heavy development right now. some of the features or APIs may change in the future 15. 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. 16. 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 at https://drupal.org/sandbox/chx/2105305 17. credits Kroly Ngyesi (chx) Mike Ryan (mikeryan) Moshe Weitzman (moshe weitzman) Ben Dougherty (benjy) 18. drupal 8 migration 19. note 20. note While a signicant 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 21. note While a signicant 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 niceand powerful migrations but at the same time we are most denitely not reinventing wheel. 22. structure/modules 23. Migrate core/modules/migrate/ 24. Migrate core/modules/migrate/ provides general API for all migrations 25. Migrate core/modules/migrate/ provides general API for all migrations provides interfaces and base classes for allmigration plugin components (source, destination, process, id_map, row). 26. Migrate core/modules/migrate/ provides general API for all migrations provides interfaces and base classes for allmigration plugin components (source, destination, process, id_map, row). provides a plugin manager for manipulation on migration plugins. 27. Migrate core/modules/migrate/ provides general API for all migrations provides interfaces and base classes for allmigration plugin components (source, destination, process, id_map, row). provides a plugin manager for manipulation on migration plugins. provides the migrate congurable (conguration entity type). 28. Migrate Drupal core/modules/migrate_drupal/ 29. Migrate Drupal core/modules/migrate_drupal/ the rst module using the new Migrate API. 30. Migrate Drupal core/modules/migrate_drupal/ the rst module using the new Migrate API. kind of migrate_d2d successor. 31. Migrate Drupal core/modules/migrate_drupal/ the rst module using the new Migrate API. kind of migrate_d2d successor. migrates out-of-the-box from Drupal 6 and 7 into Drupal 8. 32. Migrate Drupal core/modules/migrate_drupal/ the rst module using the new Migrate API. kind of migrate_d2d successor. migrates out-of-the-box from Drupal 6 and 7 into Drupal 8. Denes migrations for all system components: 33. Migrate Drupal core/modules/migrate_drupal/ the rst module using the new Migrate API. kind of migrate_d2d successor. migrates out-of-the-box from Drupal 6 and 7 into Drupal 8. Denes migrations for all system components: Drupal 6 settings (site name, slogan, roles, etc) 34. Migrate Drupal core/modules/migrate_drupal/ the rst module using the new Migrate API. kind of migrate_d2d successor. migrates out-of-the-box from Drupal 6 and 7 into Drupal 8. Denes migrations for all system components: Drupal 6 settings (site name, slogan, roles, etc) Content denitions (vocabularies, node types, etc) 35. Migrate Drupal core/modules/migrate_drupal/ the rst module using the new Migrate API. kind of migrate_d2d successor. migrates out-of-the-box from Drupal 6 and 7 into Drupal 8. Denes migrations for all system components: Drupal 6 settings (site name, slogan, roles, etc) Content denitions (vocabularies, node types, etc) Content (noded, terms, users, etc). 36. understanding migrations 37. migrations are congurables 38. small peek into congurables 39. what is a congurable? 40. what is a congurable? Congurables are conguration entities. 41. what is a congurable? Congurables are conguration entities. In Drupal 8 the content is separated fromconguration. Both are classes and are sharing the same ancestor: the Entity class. 42. what is a congurable? Congurables are conguration entities. In Drupal 8 the content is separated fromconguration. Both are classes and are sharing the same ancestor: the Entity class.DrupalCoreEntityEntity 43. what is a congurable? Congurables are conguration entities. In Drupal 8 the content is separated fromconguration. Both are classes and are sharing the same ancestor: the Entity class. DrupalCoreEntityContentEntityBaseDrupalCoreEntityEntity 44. what is a congurable? Congurables are conguration entities. In Drupal 8 the content is separated fromconguration. Both are classes and are sharing the same ancestor: the Entity class. DrupalCoreEntityContentEntityBaseDrupalCoreEntityEntity DrupalCoreConfigConfigEntityBase 45. what is a congurable? Congurables are conguration entities. In Drupal 8 the content is separated fromconguration. Both are classes and are sharing the same ancestor: the Entity class. DrupalCoreEntityContentEntityBaseDrupalCoreEntityEntity DrupalCoreConfigConfigEntityBase 46. what is a congurable? A congurable is the way Drupal 8 stores the conguration of a specic functionality. E.g. the the denition of a node type is stored in a conguration entity of type node_type. Conguration 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 'Stores user roles.', 'fields' =&gt; array( 'rid' =&gt; array( 'type' =&gt; 'serial', 'unsigned' =&gt; TRUE, 'not null' =&gt; TRUE, 'description' =&gt; 'Primary Key: Unique role id.', 70. sourceIds 71. sourceIds use TypedData identiers for data type. 72. sourceIds use TypedData identiers for data type. Here are the .yml lines that we need to add. 73. sourceIds use TypedData identiers for data type. Here are the .yml lines that we need to add. sourceIds: rid: type: integer 74. sourceIds use TypedData identiers for data type. Here are the .yml lines that we need to add. sourceIds: rid: type: integerNote: sourceIds will be removed in the near future and the source plugin will set also the primary id. 75. source 76. source we need to implement a source plugin rst, that provides the list of elds and the iterator by querying the D6 backend. 77. source we need to implement a source plugin rst, that provides the list of elds and the iterator by querying the D6 backend. lets see how it should look (code). 78. source we need to implement a source plugin rst, that provides the list of elds and the iterator by querying the D6 backend. lets see how it should look (code). add the source plugin id in the conguration .yml le. 79. source we need to implement a source plugin rst, that provides the list of elds and the iterator by querying the D6 backend. lets see how it should look (code). add the source plugin id in the conguration .yml le. source: plugin: drupal6_user_role 80. process 81. process process keys are destination elds. 82. process process keys are destination elds. for congurables: the public properties (except uuid) 83. process process keys are destination elds. for congurables: the public properties (except uuid) for content: the keys from baseFieldDefinitions 84. process process keys are destination elds. for congurables: the public properties (except uuid) for content: the keys from baseFieldDefinitions lets see how it looks! (code). 85. process process keys are destination elds. for congurables: the public properties (except uuid) for content: the keys from baseFieldDefinitions lets see how it looks! (code). process: id: label: weight: permissions: 86. destination 87. destination should point to the destination plugin. 88. destination should point to the destination plugin. in this case were importing into user_role entity, so were passing also the entity_type argument. 89. destination should point to the destination plugin. in this case were importing into user_role entity, so were passing also the entity_type argument.destination: plugin: entity entity_type: user_role 90. running a migration via drush There will be a brief UI implemented in core (to come!) 91. nal notes 92. nal notes Minor version updates are unchanged. Developers continue to use hook_update_N() for those. 93. nal notes Minor version updates are unchanged. Developers continue to use hook_update_N() for those. Contrib and custom modules are encouraged to shipwith migrations of their data from D6/D7 to D8. Use core modules as model. 94. nal notes Minor version updates are unchanged. Developers continue to use hook_update_N() for those. Contrib and custom modules are encouraged to shipwith migrations of their data from D6/D7 to D8. Use core modules as model. The underlying Migrate API is source-agnostic.Youcan easily migrate into D8 from MS SQL, Oracle, piles of HTML les, XML feeds, CSV les, etc. 95. nal notes Minor version updates are unchanged. Developers continue to use hook_update_N() for those. Contrib and custom modules are encouraged to shipwith migrations of their data from D6/D7 to D8. Use core modules as model. The underlying Migrate API is source-agnostic.Youcan easily migrate into D8 from MS SQL, Oracle, piles of HTML les, XML feeds, CSV les, etc. Similarly, Drupal 4.x and Drupal 5.x sites are able to migrate using this same approach. 96. Questions? Thank you. </p>

Recommended

View more >