annotate modules/contrib/migrate_plus/migrate_example_advanced/README.txt @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
rev   line source
Chris@0 1 INTRODUCTION
Chris@0 2 ------------
Chris@0 3 The migrate_example_advanced module demonstrates some techniques for Drupal 8
Chris@0 4 migrations beyond the basics in migrate_example. It includes a group of
Chris@0 5 migrations with a wine theme.
Chris@0 6
Chris@0 7 SETUP
Chris@0 8 -----
Chris@0 9 To demonstrate XML migrations as realistically as possible, the setup module
Chris@5 10 provides the source data as REST services. So the migrations' references to
Chris@5 11 these services can be set up accurately, if you install migrate_example_advanced
Chris@5 12 via drush be sure to use the --uri parameter, e.g.
Chris@0 13
Chris@0 14 drush en -y migrate_example_advanced --uri=http://d8.local:8083/
Chris@0 15
Chris@0 16 THE WINE SITE
Chris@0 17 -------------
Chris@0 18 In this scenario, we have a wine aficionado site which stores data in SQL tables
Chris@0 19 as well is pulling in additional data from XML services.
Chris@0 20
Chris@0 21 To make the example as simple as to run as possible, the SQL data is placed in
Chris@0 22 tables directly in your Drupal database - in most real-world scenarios, your
Chris@0 23 source data will be in an external database. The migrate_example_advanced_setup
Chris@0 24 submodule creates and populates these tables, as well as configuring your Drupal
Chris@0 25 8 site (creating node types, vocabularies, fields, etc.) to receive the data,
Chris@0 26 and providing service endpoints for XML data.
Chris@0 27
Chris@0 28 STRUCTURE
Chris@0 29 ---------
Chris@0 30 As with most custom migrations, there are two primary components to this
Chris@0 31 example:
Chris@0 32
Chris@0 33 1. Migration configuration, in the config/install directory. These YAML files
Chris@0 34 describe the migration process and provide the mappings from the source data
Chris@0 35 to Drupal's destination entities.
Chris@0 36
Chris@0 37 2. Source plugins, in src/Plugin/migrate/source. These are referenced from the
Chris@0 38 configuration files, and provide the source data to the migration processing
Chris@0 39 pipeline, as well as manipulating that data where necessary to put it into
Chris@0 40 a canonical form for migrations.
Chris@0 41
Chris@0 42 UNDERSTANDING THE MIGRATIONS
Chris@0 43 ----------------------------
Chris@0 44 Basic techniques demonstrated in the migrate_example module are not rehashed
Chris@0 45 here - it is expected that if you are learning Drupal 8 migration, you will
Chris@0 46 study and understand those examples first, and use migrate_example_advanced to
Chris@0 47 learn about specific techniques beyond those basics. This example doesn't have
Chris@0 48 the narrative form of migrate_example - it's more of a grab-bag demonstrating
Chris@0 49 varous features, and is more of a reference for, say, copying the code to set
Chris@0 50 up an XML migration. An index of things demonstrated by this module:
Chris@0 51
Chris@0 52 Multiple vocabularies populated in one migration
Chris@0 53 ------------------------------------------------
Chris@0 54 See migrate_plus.migration.wine_terms.yml.
Chris@0 55
Chris@0 56 Importing from XML services
Chris@0 57 ---------------------------
Chris@0 58 See migrate_plus.migration.wine_role_xml.yml.