Slide 1

Slide 1 text

Migration API by Spreadsheet/CSV PRESENTED BY Jayesh Makwana

Slide 2

Slide 2 text

Agenda ● Why Drupal 7 is still running and D7 needs migration? ● Ways Of Migration in Drupal ● Introduction of Drupal Migration API ● Key Concepts in Drupal Migration ● Migration Plugins & Handlers ● Required Modules ● Use case, Migration commands & Debugging ● Best Practices, Tips & Benefits of Migration API 2

Slide 3

Slide 3 text

Why Drupal 7 is still running? ● Migration Complexity (For large and huge websites) ● Less availability of modules and themes ● Budget issue ● Feel Scared of Consistency ● No awareness about Drupal 9/10 features. 3

Slide 4

Slide 4 text

Why does D7 website need migration? • Security: Drupal 7 no longer receives support or security updates after deadline. It increases the risk in your site. • Enhanced Features: Upgrading to a newer version of Drupal improves performance, scalability, and user experience. • Easy Upgrade: Easy to upgrade for next few years. • Future Approach: Take a step into Headless environment. 4

Slide 5

Slide 5 text

Ways Of Migration ● Custom SQL Queries (Not recommended) ● Core migration process ● Migration API 5

Slide 6

Slide 6 text

6

Slide 7

Slide 7 text

Introduction of Drupal Migration API ● The Migration API provides services for migrating data from a source system (OLD Drupal version/other CMS) to Drupal New version (D9/D10). ● It uses ETL process. Extract-Transform-Load 7

Slide 8

Slide 8 text

Key Concepts in Drupal Migration API •Source and Destination Systems •Migration Plugins and Configuration 8

Slide 9

Slide 9 text

Migration Plugins ● Types of Migration Plugins 9 Source Process Destination

Slide 10

Slide 10 text

Source Plugins ● It defines to source of the data and helps to fetch the data from source system. ● It supports, sourceURL, sourceDatabase, sourceCSV. 10

Slide 11

Slide 11 text

Process Plugins ● It handles the transformation of data during migration process. ● For Ex, skip_on_emtpy, explode, callback, entity_lookup, etc.. 11

Slide 12

Slide 12 text

Destination Plugins ● It gives the target location where data will be stored within Drupal. ● For Ex, destinationEntity, destinationFile, destinationConfig, etc.. 12

Slide 13

Slide 13 text

Process Diagram 13

Slide 14

Slide 14 text

Migration Handlers ● Migration Groups ● Migration Dependency ● ID Mapping ● Migration Runners 14

Slide 15

Slide 15 text

Required modules ● Core Modules • Migrate (Core) • Migrate Drupal UI (Optional) ● Contrib Modules • Migrate Plus • Migrate Source CSV/Migrate Spreadsheet • View Data Export 15 Additional Tools: drush

Slide 16

Slide 16 text

Export the Data from Drupal 7 16

Slide 17

Slide 17 text

Excel Sheet ● Save this file in project folder or suitable folder in a system. ● Use the prefix for primary key to avoid the duplication. ● Mention Worksheet name 17

Slide 18

Slide 18 text

Create A YAML 18

Slide 19

Slide 19 text

Save and Import YAML File ● Save this YAML file in your config folder. (where we store the configuration files. Default path `sites/default/files/config/sync/`) ● Then import this file configuration by using `drush cim`. ● Check the migration status: `drush ms` 19

Slide 20

Slide 20 text

Migration Status (drush ms) 20

Slide 21

Slide 21 text

Migration Import (drush mim) 21

Slide 22

Slide 22 text

Migration Rollback (drush mr) 22

Slide 23

Slide 23 text

Running Migration and Debugging ● Commands: ○ Migration status: drush ms ○ Migration import: drush mim migration_id ○ Migration rollback: drush mr migration_id ○ Migration state: drush mrs migration_id ○ Multiple migration import: drush mim migration_id1,migration_id2 ○ Migration message: drush mmsg ● Debugging ○ Custom plugins ○ Error Logs ■ Drush mmsg ■ migration _map table in database 23

Slide 24

Slide 24 text

Best Practice and Tips ● Check the Source File Mapping ● Try to start migrating with single field, and then one by one ● Use --limit=1 ● Use custom plugins for debugging ● Use migrate_map for checking failed status ● Remove unnecessary code 24

Slide 25

Slide 25 text

Benefits of Migration API ● Flexible ● Extensibility ● Update existing Entity ● Easy to target single entity type ● Controllable process ● Easy to rollback ● Less number of code (in ideal case) 25

Slide 26

Slide 26 text

26 After finishing the migration

Slide 27

Slide 27 text

27 “Everyone needs a new home, even DATA too. ”

Slide 28

Slide 28 text

Questions? 28

Slide 29

Slide 29 text

Useful References ● Source Plugin List: https://www.drupal.org/docs/8/api/migrate-api/migrate-source-plugins ● Process Plugin List: https://www.drupal.org/docs/8/api/migrate-api/migrate-process-plugi ns/list-of-core-migrate-process-plugins ● Destination Plugin List: https://www.drupal.org/docs/drupal-apis/migrate-api/migrate-destina tion-plugins-examples 29

Slide 30

Slide 30 text

30