Simplifying Migration to Drupal 8 Sugandh Khanna Drupal

  • Slides: 26
Download presentation
Simplifying Migration to Drupal 8 Sugandh Khanna | Drupal Developer, Srijan Technologies | @sugandhkhanna

Simplifying Migration to Drupal 8 Sugandh Khanna | Drupal Developer, Srijan Technologies | @sugandhkhanna 92 #Srijan. WW | @srijan

Simplifying Migrations to Drupal 8

Simplifying Migrations to Drupal 8

Presentation Outline

Presentation Outline

#Srijan. WW | @srijan

#Srijan. WW | @srijan

#Srijan. WW | @srijan Definition of Migration: ● Dictionary meaning: Movement from one part

#Srijan. WW | @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

#Srijan. WW | @srijan Earlier approach of Migrations: ● Huge Sites ● Time consuming

#Srijan. WW | @srijan Earlier approach of Migrations: ● Huge Sites ● Time consuming ● More than 100 content types and 2000 fields.

#Srijan. WW | @srijan

#Srijan. WW | @srijan

#Srijan. WW | @srijan Can we suggest Drupal 8 right away: ● for an

#Srijan. WW | @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-

#Srijan. WW | @srijan Why Migrate API? The migrate module provides a flexible framework

#Srijan. WW | @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.

#Srijan. WW | @srijan Migrate API Drupal 8 is shipped with 2 CORE Modules

#Srijan. WW | @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.

#Srijan. WW | @srijan

#Srijan. WW | @srijan

#Srijan. WW | @srijan Migration-Related Contributed Modules ● migrate_upgrade: The Drupal Upgrade contributed module

#Srijan. WW | @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 prepare. Row 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.

#Srijan. WW | @srijan

#Srijan. WW | @srijan

#Srijan. WW | @srijan Migrating Configurations Via migrate upgrade module UI Via Drush

#Srijan. WW | @srijan Migrating Configurations Via migrate upgrade module UI Via Drush

#Srijan. WW | @srijan Executing a Migration

#Srijan. WW | @srijan Executing a Migration

#Srijan. WW | @srijan Executing a Drupal 7 to Drupal 8 migrate Prerequisites: ●

#Srijan. WW | @srijan Executing a Drupal 7 to Drupal 8 migrate Prerequisites: ● ● ● PHP 5. 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

#Srijan. WW | @srijan

#Srijan. WW | @srijan

#Srijan. WW | @srijan Migration Process

#Srijan. WW | @srijan Migration Process

#Srijan. WW | @srijan Legacy: connecting to the source database (D 7) $databases['legacy']['default'] =

#Srijan. WW | @srijan Legacy: connecting to the source database (D 7) $databases['legacy']['default'] = array ( 'database' => 'd 7 database', 'username' => 'root', 'password' => 'root', 'prefix' => '', 'host' => 'localhost', 'port' => '3306', 'namespace' => 'Drupal\Core\Database\Driver\mysql', 'driver' => 'mysql', );

#Srijan. WW | @srijan Your database user name Your database password Your drupal 7

#Srijan. WW | @srijan Your database user name Your database password Your drupal 7 database Magic Drush command drush migrate-upgrade --legacy-dburl=mysql: //user: pass@12. 34. 56. 78/d 6 db --legacyroot=http: //myd 6 site. com Legacy being the keyword to connect both databases. (explain further in next slide. )

Final touch. . . #Srijan. WW | @srijan drush migrate-upgrade --configure-only --legacy-dburl=mysql: //root: root@localhost/database

Final touch. . . #Srijan. WW | @srijan drush migrate-upgrade --configure-only --legacy-dburl=mysql: //root: root@localhost/database 7 --legacyroot=/path/to/sites/default/files. Generate migration configuration entities

#Srijan. WW | @srijan If you run drush migrate-status(ms), a hug list of migrations

#Srijan. WW | @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

#Srijan. WW | @srijan Migrate Tools Drush commands supported include: ● ● ● migrate-status

#Srijan. WW | @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.

#Srijan. WW | @srijan Migrations that are not yet supported: ● Views ● Multilingual

#Srijan. WW | @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.

#Srijan. WW | @srijan Known Issues with the Drupal 7 -> 8: ● Blocked

#Srijan. WW | @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.

#Srijan. WW | @srijan Any Questions?

#Srijan. WW | @srijan Any Questions?