Simplifying Migration to
Drupal 8
Sugandh Khanna | Drupal Developer, Srijan Technologies |
@sugandhkhanna92
#SrijanWW | @srijan
Simplifying Migrations to Drupal 8
Presentation Outline
#SrijanWW | @srijan
#SrijanWW | @srijan
Definition of Migration:
● Dictionary meaning: Movement
from one part of something to
another.
● In Drupal way: Migration is an
Extract, Transform, Load(ETL)
process.
● Flexible services and innovative
solutions at effective pricing
#SrijanWW | @srijan
Earlier approach of Migrations:
● Huge Sites
● Time consuming
● More than 100 content types and 2000
fields.
#SrijanWW | @srijan
#SrijanWW | @srijan
Can we suggest Drupal 8 right
away:
● for an existing SIMPLE project? -YES-
● for an existing COMPLEX project? -NO-
● for an NEW project? -YES-
#SrijanWW | @srijan
Why Migrate
API?
The migrate module provides a
flexible framework for migrating
content into Drupal from other
sources (e.g., when converting a
website from another CMS to
Drupal).
Out-of-the-box, support for creating
core Drupal objects such as nodes,
users, files, terms, and comments are
also included - it can easily be
extended for migrating other types
of content. Content is imported and
rolled back using a bundled web
interface (Migrate UI module) or
included Drush commands.
#SrijanWW | @srijan
Migrate API
Drupal 8 is shipped with 2 CORE Modules that provides API for
Migration
● migrate: This Drupal core module provides the underlying API
for migrating configuration and content to Drupal 8.
● migrate_drupal: This Drupal core module provides the classes
specifically needed to migrate configuration and content from a
Drupal site to Drupal 8.
#SrijanWW | @srijan
#SrijanWW | @srijan
Migration-Related Contributed Modules
● migrate_upgrade: The Drupal Upgrade contributed module provides the
tools necessary for performing an upgrade from Drupal 7 to drupal 8 --
both a simple user interface as well as drush commands.
● migrate_plus: The Migrate Plus contributed module provides optional
enhancements, including groups and prepareRow events, to the core
Migrate API.
● migrate_tools: Part of the Migrate Plus project, this module provides
optional drush and UI tools for managing your migrations.
#SrijanWW | @srijan
#SrijanWW | @srijan
Migrating Configurations
Via DrushVia migrate upgrade module UI
#SrijanWW | @srijan
Executing a Migration
#SrijanWW | @srijan
Executing a Drupal 7 to Drupal 8 migrate Prerequisites:
● PHP5.6 or greater.
● Install Drush 8.x
● A Drupal 7 site database (Source should be localised).
● The very latest version of Drupal 8.
● Having the Migrate Upgrade module downloaded and enabled,
which will turn on all the various dependencies (migrate_upgrade,
migrate_drupal, migrate).
● Write permissions for Drush to the config directory. Example sudo
chmod -R a+w sites/default/files/config__*/active
#SrijanWW | @srijan
#SrijanWW | @srijan
Migration Process
#SrijanWW | @srijan
$databases['legacy']['default'] = array (
'database' => 'd7database',
'username' => 'root',
'password' => 'root',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'namespace' => 'DrupalCoreDatabaseDrivermysql',
'driver' => 'mysql',
);
Legacy: connecting to the source database (D7)
#SrijanWW | @srijan
Magic Drush command
drush migrate-upgrade
--legacy-db-url=mysql://user:pass@12.34.56.78/d6db
--legacy-root=http://myd6site.com
Legacy being the keyword to connect both databases. (explain further in next slide.)
Your database user
name
Your database
password
Your drupal 7
database
#SrijanWW | @srijan
.
drush migrate-upgrade --configure-only
--legacy-db-url=mysql://root:root@localhost/database7
--legacy-root=/path/to/sites/default/files
Generate migration configuration entities
Final touch...
#SrijanWW | @srijan
If you run drush migrate-status(ms), a hug list of migrations
will appear.
You can review then selectively execute the migrations by
using the following drush commands
#1 drush migrate-import {migrationname}
#2 drush migrate-import --all
#SrijanWW | @srijan
Migrate Tools
Drush commands supported include:
● migrate-status - Lists migrations and their status.
● migrate-import - Performs import operations.
● migrate-rollback - Performs rollback operations.
● migrate-stop - Cleanly stops a running operation.
● migrate-reset-status - Sets a migration status to Idle if it gets stuck.
● migrate-messages - Lists any messages associated with a migration import.
#SrijanWW | @srijan
Migrations that are not yet
supported:
● Views
● Multilingual content
● custom fields and content types
Migrations that supported:
● Only content, users, taxonomy, blocks,
menus, filter formats.
#SrijanWW | @srijan
Known Issues with the Drupal 7 -> 8:
● Blocked IPs: The id column from Drupal 7's ban_ip_table is not
migrated.
● Menu UI: The menu_primary_links_source and
menu_secondary_links_source variables not migrated, because they
do not have counterparts in drupal 8.
● PHP code: It will be replaced with filter_null, which simply displays an
empty string. PHP code is not supported in Drupal 8 core -- it's very
bad practice.
● Views: Views are not yet migrated.
#SrijanWW | @srijan
Any Questions?

[Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

  • 1.
    Simplifying Migration to Drupal8 Sugandh Khanna | Drupal Developer, Srijan Technologies | @sugandhkhanna92 #SrijanWW | @srijan
  • 2.
  • 3.
  • 4.
  • 5.
    #SrijanWW | @srijan Definitionof Migration: ● Dictionary meaning: Movement from one part of something to another. ● In Drupal way: Migration is an Extract, Transform, Load(ETL) process. ● Flexible services and innovative solutions at effective pricing
  • 6.
    #SrijanWW | @srijan Earlierapproach of Migrations: ● Huge Sites ● Time consuming ● More than 100 content types and 2000 fields.
  • 7.
  • 8.
    #SrijanWW | @srijan Canwe suggest Drupal 8 right away: ● for an existing SIMPLE project? -YES- ● for an existing COMPLEX project? -NO- ● for an NEW project? -YES-
  • 9.
    #SrijanWW | @srijan WhyMigrate API? The migrate module provides a flexible framework for migrating content into Drupal from other sources (e.g., when converting a website from another CMS to Drupal). Out-of-the-box, support for creating core Drupal objects such as nodes, users, files, terms, and comments are also included - it can easily be extended for migrating other types of content. Content is imported and rolled back using a bundled web interface (Migrate UI module) or included Drush commands.
  • 10.
    #SrijanWW | @srijan MigrateAPI Drupal 8 is shipped with 2 CORE Modules that provides API for Migration ● migrate: This Drupal core module provides the underlying API for migrating configuration and content to Drupal 8. ● migrate_drupal: This Drupal core module provides the classes specifically needed to migrate configuration and content from a Drupal site to Drupal 8.
  • 11.
  • 12.
    #SrijanWW | @srijan Migration-RelatedContributed Modules ● migrate_upgrade: The Drupal Upgrade contributed module provides the tools necessary for performing an upgrade from Drupal 7 to drupal 8 -- both a simple user interface as well as drush commands. ● migrate_plus: The Migrate Plus contributed module provides optional enhancements, including groups and prepareRow events, to the core Migrate API. ● migrate_tools: Part of the Migrate Plus project, this module provides optional drush and UI tools for managing your migrations.
  • 13.
  • 14.
    #SrijanWW | @srijan MigratingConfigurations Via DrushVia migrate upgrade module UI
  • 15.
  • 16.
    #SrijanWW | @srijan Executinga Drupal 7 to Drupal 8 migrate Prerequisites: ● PHP5.6 or greater. ● Install Drush 8.x ● A Drupal 7 site database (Source should be localised). ● The very latest version of Drupal 8. ● Having the Migrate Upgrade module downloaded and enabled, which will turn on all the various dependencies (migrate_upgrade, migrate_drupal, migrate). ● Write permissions for Drush to the config directory. Example sudo chmod -R a+w sites/default/files/config__*/active
  • 17.
  • 18.
  • 19.
    #SrijanWW | @srijan $databases['legacy']['default']= array ( 'database' => 'd7database', 'username' => 'root', 'password' => 'root', 'prefix' => '', 'host' => 'localhost', 'port' => '3306', 'namespace' => 'DrupalCoreDatabaseDrivermysql', 'driver' => 'mysql', ); Legacy: connecting to the source database (D7)
  • 20.
    #SrijanWW | @srijan MagicDrush command drush migrate-upgrade --legacy-db-url=mysql://user:pass@12.34.56.78/d6db --legacy-root=http://myd6site.com Legacy being the keyword to connect both databases. (explain further in next slide.) Your database user name Your database password Your drupal 7 database
  • 21.
    #SrijanWW | @srijan . drushmigrate-upgrade --configure-only --legacy-db-url=mysql://root:root@localhost/database7 --legacy-root=/path/to/sites/default/files Generate migration configuration entities Final touch...
  • 22.
    #SrijanWW | @srijan Ifyou run drush migrate-status(ms), a hug list of migrations will appear. You can review then selectively execute the migrations by using the following drush commands #1 drush migrate-import {migrationname} #2 drush migrate-import --all
  • 23.
    #SrijanWW | @srijan MigrateTools Drush commands supported include: ● migrate-status - Lists migrations and their status. ● migrate-import - Performs import operations. ● migrate-rollback - Performs rollback operations. ● migrate-stop - Cleanly stops a running operation. ● migrate-reset-status - Sets a migration status to Idle if it gets stuck. ● migrate-messages - Lists any messages associated with a migration import.
  • 24.
    #SrijanWW | @srijan Migrationsthat are not yet supported: ● Views ● Multilingual content ● custom fields and content types Migrations that supported: ● Only content, users, taxonomy, blocks, menus, filter formats.
  • 25.
    #SrijanWW | @srijan KnownIssues with the Drupal 7 -> 8: ● Blocked IPs: The id column from Drupal 7's ban_ip_table is not migrated. ● Menu UI: The menu_primary_links_source and menu_secondary_links_source variables not migrated, because they do not have counterparts in drupal 8. ● PHP code: It will be replaced with filter_null, which simply displays an empty string. PHP code is not supported in Drupal 8 core -- it's very bad practice. ● Views: Views are not yet migrated.
  • 26.