How to Migrate Drupal 6 to Drupal 8?

  • Published on
    20-Feb-2017

  • View
    219

  • Download
    0

Transcript

Preparing to MigrateD6/7 to D8Most tempting features of Drupal 8 Fastest Drupal ever, out-of-the-box -- BigPipe & Placeholdering. No more cluttering with database-stored configuration -- Makes Deployment Easier with exportable configurations. New theme system based on Twig -- 154 Theme functions has been removed & replaced with TWIG Templates. Symfony2 as a base layer for Drupal 8 -- HttpKernel and HttpFoundation, Yaml, EventDispatcher, ClassLoader etc.Importance of Analysis & Fore Seeking Update Status(Drupal 5) / Upgrade Status must be used for analysis. Ink is better than the best memory - Documentation A virtual view/workflow of Migrated Website before migration - Fore SeekingModules Porting TrackerStatus of the Top 100 Contributed Modules for Drupal 8 19 projects are in core. 16 projects have an available non-development release. 37 projects have an available development release. 28 projects have no available D8 release.https://contribkanban.com/board/contrib_trackerCan we suggest Drupal 8 right away : for an existing SIMPLE project? -YES- for an existing COMPLEX project? -NO- for a NEW project? -YES-Migration Support from Drupal : The system for upgrading Drupal sites has been completely re-written for Drupal 8 Support for Drupal 6 & Drupal 7 to Drupal 8 Drupal 6: core + CCK + Link + Email + Phone + ImageCache modules. Drupal 7: only content, users, taxonomy, blocks, menus, filter formats.More support for Drupal 7 to Drupal 8 is coming soon.Migrations that are not yet supported : Views (Drupal 6 & Drupal 7) Multilingual content (i18n Module Drupal 6 & Drupal 7) Node, user, entity references (Drupal 6)Currently, contributed modules are required to run migrations to Drupal 8Known Issues with the Drupal 6/7 -> 8Drupal 6 to Drupal 8 Node Types : Default configuration in D6 was to create Story and Page content types but in Drupal 8 the default types are Article and Basic Page (which has a machine name 'page' just like in D6). URL Aliases : When migrating url aliases for a language that is not enabled on the new Drupal 8. Menu UI : The menu_primary_links_source and menu_secondary_links_source variables are not migrated, because they do not have counterparts in Drupal 8.Known Issues with the Drupal 6/7 -> 8Drupal 6 to Drupal 8 Profile categories : Fields grouped by the Profile module in D6 will not be grouped in D8. Profile field (list selection) : The "allowed values" setting of the resulting field in D8 will be a combination of all selected user values and the current allowed values in D6. Date formats : Only the default, short, medium and long formats are migrated. All other formats default to the fallback format and need to be reconfigured after migration. Text/Input formats : It will be replaced by a null filter which simply displays an empty string.The PHP filter is not supported in Drupal 8 core -- it's very bad practiceKnown Issues with the Drupal 6/7 -> 8Drupal 6 to Drupal 8 Views : Views are not yet migrated. Aggregator Categories : Drupal 8 no longer has the concept of aggregator categories and therefore they're not migrated to D8. Allowed protocols : Drupal 8 now stores the protocols in "filter_protocols" container parameter, so in case you had changed the variable "filter_allowed_protocols", enter it into your services.yml file.Known Issues with the Drupal 6/7 -> 8Drupal 7 to Drupal 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.A Brief description about Drupal 8 Migration APIDrupal 8 Migration APIMigration is an Extract, Transform, Load (ETL) process.For historical reasons, in the Drupal migration tool : the extract phase is called "source" - Source Plugins, the transform phase is called "process" - Process Plugins, the load phase is called "destination" - Destination Plugins, Migration configuration entities - (IDs,Configs & dependencies) , Migration manifests - drush migrate-manifest provides a list of migrations.Migration-Related Modules and PluginsMigration-Related Core ModulesDrupal 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.Why 2 Core Modules for Migration ?Migration-Related Contributed Modules Drupal Upgrade (migrate_upgrade) : The Drupal Upgrade contributed module provides the tools necessary for performing an upgrade from Drupal 6 or Drupal 7 to Drupal 8 both a simple user interface (at /upgrade) as well as drush commands. There is on-going work to get the UI moved to Drupal core. 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. Migration plugins : Migration plugins for each core module are located within each module's directory. For example, the migration classes that handle taxonomy vocabularies and terms are located in the core taxonomy module.Executing a MigrationExecuting a Drupal 6/7 to Drupal 8 upgradePrerequisites: PHP 5.5.9 or greater. Install Drush 8.x A Drupal 6 or Drupal 7 site database (it is not recommended to run migrations against a production database; make a copy) Source should be Localised. The very latest version of Drupal 8. Having the Migrate Upgrade module downloaded & 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 Most important note on Migrating to D8 This is different than the way the Migrate worked in Drupal 7 and earlier versions Note that you do not have to create all the content types and fields manually before running this upgrade! The Migrate module will create them as a part of the migration process.How to use D8 Migrate ? There are 2 Ways#1 Using the Migrate Upgrade Module UI It is Easier but risky as it's still under heavy development, so things may break. There is support team available for migration in case any critical issues. After Installing the Migrate Upgrade module, go to Drupal 8 site's /upgrade page. Now, You will see the home screen with Help Texts.#2 Using Drush Migrate Upgrade module is shipped with drush commandsDrush command : drush migrate-upgrade --legacy-db-url=mysql://user:password@server/db --legacy-root=http://localhost/drupal6 . To Add more flavours to Migration, We have Migrate Tools Module which is a part of Migrate Plus Module. Migrate Tools provides more drush commands.Drush Commands : drush migrate-status (ms) and drush migrate-import (mi) drush migrate-upgrade has 2 set of processUsing Drush Migrate Upgrade & Tools It will generate migrations for your site, based on migrate_drupal's migration templates and your configured source site. For instance, the d6_book migration is only created if the Book module is enabled on both your Drupal 6 and Drupal 8 sites. It executes every created migration, in dependency order. To have more Control on this Drush Command ,Migrate tools comes into play.(--configure-only).You have to pass --configure-only option to the drush commanddrush migrate-upgrade --legacy-db-url=mysql://user:password@server/db --legacy-root=http://localhost/drupal6 --configure-only option.Using Drush Migrate Upgrade & Tools If you run drush migrate-status (ms), a huge list of migrations will appear. You can review then selectively execute the migrations by using the following drush commands#1 drush migrate-import {migration name}#2 drush migrate-import --allNote : If you are not able to see the migrated fields in Edit Page as well as in View PageCheck the Manage Form Display in each content type and change the fields settings and forview page you can change it Manage Display TabBrushing up on Drush & Drupal ConsoleDrush : The Swiss Army Knife for Drupal (More Robust)Drupal ConsoleDrupal Console : Sports the modern Symfony Console component, that provides a new object-oriented interface for command line tools, exposing the power of the Symfony framework to script developers. Which is better for Drupal 8. Generates Code & Runs Testing.Drupal 8 development will get improved and it can be streamlined well, when Drush is used with Drupal Console for D8 development. http://drupalconsole.com/ My Hearty Thanksto you all &http://drupal.orgAdhitya Rajkumar@DrupalGeeks