Transcript
Page 1: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

Simplifying Migration to Drupal 8

Sugandh Khanna | Drupal Developer, Srijan Technologies | @sugandhkhanna92

#SrijanWW | @srijan

Page 2: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

Simplifying Migrations to Drupal 8

Page 3: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

Presentation Outline

Page 4: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Page 5: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#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

Page 6: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Earlier approach of Migrations:

● Huge Sites● Time consuming● More than 100 content types and 2000

fields.

Page 7: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Page 8: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

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

Page 9: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

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

Page 10: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Migrate APIDrupal 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.

Page 11: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Page 12: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

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

Page 13: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Page 14: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Migrating Configurations

Via Drush Via migrate upgrade module UI

Page 15: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Executing a Migration

Page 16: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#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

Page 17: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Page 18: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Migration Process

Page 19: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

$databases['legacy']['default'] = array ( 'database' => 'd7database',

'username' => 'root', 'password' => 'root',

'prefix' => '', 'host' => 'localhost',

'port' => '3306', 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',

'driver' => 'mysql',);

Legacy: connecting to the source database (D7)

Page 20: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Magic Drush commanddrush migrate-upgrade

--legacy-db-url=mysql://user:[email protected]/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

Page 21: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

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

Page 22: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#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

Page 23: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

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

Page 24: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

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

Page 25: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

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

Page 26: [Srijan Wednesday Webinars] Simplifying Migration to Drupal 8

#SrijanWW | @srijan

Any Questions?


Recommended