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
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
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