Post on 31-Mar-2020
Simply migration: Drupal 7 to 8 with one click
Case study :: Work in progress Irina Zaks izaks@stanford.edu http://fibonacciwebstudio.com/
Introduction Website migrations starting 4.7 to
5, 6, 7 Drupal content migration
between major versions – major issue
Drupal upgrade in version 8 one of most pleasant surprises
In this demo We will talk about Standard Upgrade
via web interface Customizing
migration paths Drupal 8 Stanford-
look theme Using Features for
layouts with blocks and views
We will not discuss Any DevOps
questions Twig Composer All great new things
in Drupal 8 World Peace .... and many more
4.7 to 5 to 6 Always an adventure
6 to 7 Routine exercise using feeds
6/7 to 8 Pleasant walk in the park
STORY OF OUR JOURNEY
DevOps Thanks to Pantheon Dev / test / multidev instances Backups Db / files export/import Drush
What we had Drupal 7 site with will organized
content ◦ Stanford Modules – page, news, events,
person ◦ Custom modules – research project,
research topic, etc. Visual design for new layouts with
Stanford look and feel
What we did not have Drupal 8 Stanford-look theme Modules to provide functionality of the
new site ◦ Feeds for ongoing imports including
people profiles ◦ Workflows via Rules
Content migration process
Beginning the journey Set up new site on Pantheon http://dev-standford-drupalcamp-
demo-8.pantheonsite.io/
Theme Developed new theme consistent with
current theme for sites.stanford.edu Bootstrap based Stanford light 728 https://bitbucket.org/izaks/
stanford_light_728
Modules Review modules that we used in Drupal 7 Add on first install
1. Admin Toolbar (replaces Admin Menu) 2. Pathauto (requires token and ctools) 3. Devel 4. Features 5. Display Suite
Ready for use - optional 1. Paragraphs (better version of field collections) 2. Webform
Still in development ◦ Feeds ◦ Rules
Demo setup Hosted on Pantheon Drupal 7 site
http://dev-standford-drupalcamp-demo-7.pantheonsite.io/ ◦ Front page ◦ Stanford Page with image and link in main
menu ◦ Stanford News content type (module) ◦ Recent news views with menu link set in
views
Demo Enable Migrate, Migrate Drupal,
Migrate Drupal UI -> Configure http://dev-standford-drupalcamp-
demo-8.pantheonsite.io/upgrade Upgrade via web interface
Connect to “origin” site Db - dbserver.dev.
63f81f1d-580b-4339-b576-15bee906f55f.drush.in
User / db pantheon Password
7fae4673aac34f0c9572af794926f06a port 22216 File path http://dev-standford-
drupalcamp-demo-7.pantheonsite.io/
List of default migration paths 17 available upgrade paths ◦ core modules
49 missing upgrade paths ◦ contrib modules ◦ other features
Continue
Demo – Recent Log messages admin/reports/dblog?page=1
http://dev-standford-drupalcamp-demo-8.pantheonsite.io/upgrade
Standard upgrade – what works Menu items – set in menus, not views Creates content types / fields even if
there is no nodes of this content type Moves content – nid’s are preserved Url aliases Moves users / roles Reports every step of upgrade in a log Not found or access denied links go to
front page by default
Standard upgrade – what does not work Date field comes with incorrect format “Plain HTML” format does not work as
expected Field collections do not have upgrade
path Other issues we are discovering as
we go
Other notes from migration We used Features for ◦ Views ◦ Blocks configuration - migrated but not set
in same regions Migration rollbacks ◦ Pantheon Backup
ENTERS DRUSH
Custom updates with drush Add modules ◦ Drupal Upgrade ◦ Migrate Tools ◦ Migrate Manifest ◦ Migrate Plus
drush migrate-upgrade [options] – config-only (does not move content)
drush migrate-status (optional) drush migrate-manifest manifest-
news.yml, manifest-events.yml
Migrate Manifest Standard manifest installed with
Migrate Manifest Module in root directory /manifest.yml
Intercept standard upgrade and launch custom manifest(s) ◦ /manifest2.yml ◦ /manifest-news.yml ◦ /manifest-date.yml
Custom migrations Date format - completed Problem: Date format changed ◦ Drupal 7 1994-11-05 08:15:30-05:00 ◦ Drupal 8 1994-11-05T08:15:30-05:00
Solution ◦ manifest-news.yml calls to custom module
(d7_node_stanford_news) ◦ d7_node_stanford_news module includes
configuration for migration field_s_new_date:
Plugin: convert_date Source: field_s_news_date
◦ Plugin ConvertDate.php Converts date
Custom Migrations Field Format – work in progress
Drupal 7 – text field Drupal 8 – new field
Migrations and updates One time migration full migration Ongoing updates from Drupal 7 to
Drupal 8 sites Feeds from other sites
Next steps and wish list Date standard upgrade path Views upgrade path – some modules
in development Feeds module for Drupal 8 Rules updates for Drupal 8