SlideShare a Scribd company logo
Migrating to Drupal 8
How to Migrate Your Content and Minimize
the Risks
Acquia Webinar, 11-May-2015
The 5 phases of migration
→ Auditing the source site
→ Planning the new data model
→ Prepping for migration
→ Planning the migration
→ Launching the migration
Phase 1: Source site audit
Taxes? Nope, understand your beginnings.
Know your source site
Primary for a smooth migration:
→ What does my site contain? (data structures)
→ What does my site use? (contrib and custom modules)
→ What does my site look like? (contrib or custom
themes)
Simple or Complex
Questions to ask yourself:
→ Are you looking to essentially migrate everything?
→ How complex do you believe your site to be?
→ Do you have time to try a basic and direct migration?
→ Do you have cleanup you wish to perform?
Data structure: bundles, fields, entities
→ Content types
→ Fields (migrate_tools’ migrate-fields-source Drush
commands can help with this)
→ Menus
→ Vocabularies
→ Taxonomy terms
→ Users
Visualize your entities and fields
Features/Modules
→ Advanced search
▪ i.e. Search API + Search API Solr + Acquia Search
→ External Authentication
▪ SimpleSAMLphp, LDAP, OAuth
→ Rebuilding views used in D6 or D7
▪ Manual process
▪ Missing contrib modules?
→ Commonly used modules:
▪ Pathauto, Redirect, Purge, et cetera.
→ Simple Sitemap module to generate Sitemap.xml file
Are the contrib modules required for
your site available yet on D8?
→ Check out Drupal 8 Contrib Porting Tracker
▪ https://www.drupal.org/project/contrib_tracker
More Questions
→ Are the skills available to rewrite custom modules?
→ Are those custom modules still necessary or does D8
introduce better solutions in Core or Contrib?
→ Is there a cutover window?
→ Is new content being added and are site alterations
being made while the site content is being migrated?
Discuss some of the challenges
→ Learning D8
▪ We started assembling module building lessons:
• https://docs.acquia.com/articles/building-drupal-8-modules
→ Find skilled assistance to fill skill gaps
→ Identify impacted stakeholders
▪ Including stakeholders in the launch and post-
launch process
▪ Insuring they are there to test.
▪ Insuring continued buy-in and collaboration
Phase 2: Data model planning
Congrats!
You’ve chosen a complex migration/cleanup
Plan, consult, resolve, goto 10
10 Plan out what content you expect to see
20 Consult with interested parties [time boxed]
30 Resolve any issues in your model
40 goto 10
What’s in a name?
When building it’s important to communicate as much as
possible, as concisely as possible with structure.
→ i.e. Authors: field_article_author became field_authors
→ i.e. Drupal Projects: field_terms_project became
field_projects_drupal
Often there isn’t a single right answer, consistency is key.
Issues we encountered
1. Typos and misspellings in source
2. Merging fields
3. Processing fields
Review Date (date-time)
→ field_date_review
→ field_review_date (content type A)
▪ date
→ field_revew_date (content type B)
▪ date-time
▪ required using hours:minutes + date
▪ possible bug requiring fix?
Trouble merging two similar fields
Simple wins
1. Coordinating the machine names
2. Type and spelling fixes in machine names
3. Opportunity to change data-type
Phase 3 - Migration prep or:
How We Learned to Stop Worrying and Love the Migrate API
What’s in core today?
A quick overview of contrib modules
Module Description
migrate_upgrade Drush commands for running upgrades from Drupal 6 or 7
to Drupal 8
migrate_tools General-purpose Drush commands and basic UI for
managing migrations
migrate_plus Extends the core migration framework with additional
functionality (e.g. migration from XML and JSON sources)
migrate_ui UI on top of Migration entities in core
migrate_manifest Drush command for running template-based SQL
migrations from a manifest file
Dataset and data model, please.
→ Are we migrating one thousand or one million items?
→ Do you have any data model change?
→ Migrating via the UI is almost never a good solution
▪ Doesn’t allow for custom migrations
▪ Drush scales better
▪ Contrib has powerful and flexible Drush commands
Get started with migration modules
$ drush @site.env en -y migrate_drupal, migrate_upgrade,
migrate_tools
The following extensions will be enabled: migrate_drupal,
migrate_upgrade, migrate_tools, migrate, migrate_plus
→ Use branch 8.x-2.x for all migration modules
→ Get the DB connection settings for the source site
→ Get familiar with the new Drush migration commands
$ drush | grep migrate
Configure your initial migration
$ drush @site.env migrate-upgrade --legacy-db-url=mysql://
{USER}:{PASSWORD}@{HOST}:{PORT}/{DB} --legacy-root={URI} --
configure-only
→ All necessary YAML files should now be exported
→ Audit with Drush Configuration Management commands
$ drush config-list | grep -c migrate
62
Confirm your migration key is set
>>> Drupal::>>> Drupal::state()->get('migrate_drupal_6');
=> [
"key" => "upgrade",
"database" => [
"driver" => "mysql",
"username" => "{USER}",
"password" => "{PASSWORD}",
"host" => "{HOST}",
"port" => "{PORT}",
"database" => "{DB}",
"prefix" => null,
],
]
Run a full migration
$ drush @site.env migrate-upgrade --legacy-db-url=mysql://
{USER}:{PASSWORD}@{HOST}:{PORT}/{DB} --legacy-root={URI}
→ Straightforward migration...but not extremely flexible
→ You probably need control at all levels of the migration
→ Enter the migrate-import Drush command
Create a custom module (it’s easy!)
→ Create your *.info.yml file
→ Add your exported migration files to config/install
→ Enable your module. That’s it.
$ drush @site.env config-export -y sync ; cp
/path/to/config_dir/sync/migrate_plus.migration*
/path/to/custom/module/config/install/
Run a custom migration
$ drush @site.env migrate-import --group=migrate_drupal_6 --
limit=10000 --feedback=1000
$ drush @site.env migrate-import d6_url_alias,d6_block, d6_file,
d6_user,{...} --limit=10000 --feedback=1000
→ Use --limit to limit on the number of items to process
→ Use --feedback to be notified of progress
→ You can even arbitrarily restrict by source plugin
Migration status and messages
$ drush @site.env migrate-status
$ for i in upgrade_d6_node_type upgrade_d6_user {...} ; do drush
@site.env migrate-messages $i ; done
→ Use migrate-status to have an overview of (last)
imported, unprocessed and total number of items, etc.
→ Use migrate-messages to catch migration errors
What about really custom migrations?
→ It still mostly is the Migrate you know and like
▪ prepareRow()
▪ query()
▪ ...
→ Extend default core Migrate source plugins
→ Write your own source Plugins
Sample custom source Plugin
<?php
namespace Drupalmigrate_webinarPluginmigratesource;
use DrupalpathPluginmigratesourced6UrlAlias;
/**
* @MigrateSource(
* id = "webinar_d6_url_alias"
* )
*/
class WebinarUrlAlias extends UrlAlias {
public function query() {
$query = parent::query();
$query->condition('src', 'user/%', 'NOT LIKE');
return $query;
}
}
Core source Plugin
Plugin annotation
Custom logic via the
query() method
Migration tips and tricks
→ The Migration API is still in flux. Check drupal.org!
▪ Major changes in Drupal 8.1.x - Check http:
//mikeryan.name/blog/mikeryan/migration-
update-for-drupal-8-1
→ See a d6 or d7 string in a migration filename?
▪ It’s specific to this Drupal version
▪ If you don’t see anything, it works for both
→ Start backwards with custom migrations
▪ Use a minimalistic set of migration files first
▪ Add the required dependencies as you go
Phase 4: Migration planning & strategy
The devil is in the...
Stages of migration
1. Initial development - Used Dev and Test
2. Working through the migration bugs
3. Prepping prod (check and triple check)
4. Code “almost ready” - test migration manually
5. Switch to continuous content migration (failed)
▪ dev for active migration work
▪ stage for QA
▪ prod for lead up to launch
6. Test until your eyes and fingers bleed (joke, !joke)
Why continuous content migration
→ This allows code fixes to be rolled into place until very
shortly (48 hours) before launch.
→ Why did we fail?
▪ Tokens in content
▪ Most in place but some had to be manually moved
→ Result -> migration was semi-continuous but we
needed longer window for move (one week).
▪ If “no-go called” -> redo the manual migration
▪ Generated pressure
Continuous migration of content
$ ssh -i /home/{USERNAME}/{SSH_KEY} -f -L 1111:{DB_SERVER}:3306
{USER}@{WEB_SERVER} -N
→ Can you afford a hard cutover/downtime?
→ Use SSH tunneling for maximum security
→ https://docs.acquia.com/articles/ssh-tunneling-server-
side-applications
Now’s your chance
Take the migration to D8 as an opportunity to get rid of
bad old habits!
→ PHP filter
→ Full HTML
→ Improve editorial Workflow
▪ Multiversion (must be in place prior to migration)
▪ Workbench Moderation
However, Don’t fall down the rabbit hole!
Phase 5: Launch
Where the rubber meets the road!
Plan for go/no-go decision
→ This is probably one of the hardest processes to plan.
→ Complete buy-in from stakeholders is needed.
→ Clearly record and communicate.
→ Set a reasonable and firm timeline.
→ Set the conditions for why to delay.
→ If possible stick to the timeline when launching.
→ Try to mitigate risk where possible
▪ sometimes this means delaying a launch
▪ sometimes this means going and fixing post launch
Our plan: what worked
→ Content Freeze
→ Window for migration
→ Focusing on content as the priority
→ Iterative development with Minimal Viable Product
▪ identifying key needs
▪ addressing non-critical path issues after launch
→ Replaced a lot of older code just by using D8 core
Our plan: what didn’t work
→ Misaligned expectations
▪ incomplete go/no-go plan
→ Working against a hard deadline (Drupal 6 EOL)
→ Not enough time planned for encountering bugs in
custom migration
→ Missing contrib modules
→ Finding time to contribute to porting modules
Ensure assets consistency
mysql> SELECT COUNT(fid) FROM file_managed;
$ find . ! -path "*styles*" ! -path "*ctools*" ! -path "*css*" !
-path "*js*" ! -path "*xmlsitemap*" -type f | wc -l
$ rsync -avz --progress --exclude=styles --exclude=ctools --
exclude=css --exclude=js --exclude=xmlsitemap -e "ssh -i /home/
{USERNAME}/.ssh/id_rsa" {SOURCE_SERVER}:{SOURCE_PATH} .
→ Not all files are necessarily managed by Drupal
→ Use rsync when the Migrate API can’t help
We hope you learned about...
1. How to audit: bundles, fields, and entities
2. Planning steps: stay, go, and modify
3. Migrate API and contrib migration modules
4. Process: near-continuous migration of content to
minimize downtime
5. Effectively creating, implementing a risk mitigation plan
Thank You - Questions?

More Related Content

PDF
Migrating data to drupal 8
PPTX
Migration from Legacy CMS to Drupal
PDF
Become a Better Developer with Debugging Techniques for Drupal (and more!)
PDF
Migrate to Drupal 8
PDF
Common Pitfalls for your Drupal Site, and How to Avoid Them
PDF
Drupal 8 Render Cache
PPT
Html5 drupal7 with mandakini kumari(1)
PPT
Taking your module from Drupal 6 to Drupal 7
Migrating data to drupal 8
Migration from Legacy CMS to Drupal
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Migrate to Drupal 8
Common Pitfalls for your Drupal Site, and How to Avoid Them
Drupal 8 Render Cache
Html5 drupal7 with mandakini kumari(1)
Taking your module from Drupal 6 to Drupal 7

What's hot (20)

PDF
Nuvola: a tale of migration to AWS
PDF
Drupal Is Not Your Web Site
PDF
Everything You Need to Know About the Top Changes in Drupal 8
PDF
Mobile & Desktop Cache 2.0: How To Create A Scriptable Cache
ODP
Solid and Infrastructure as Code
PDF
Drupal is not your Website
PDF
Evolution of Drupal and the Drupal community
ODP
Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...
PDF
Device Synchronization with Javascript and PouchDB
PDF
Big query - Command line tools and Tips - (MOSG)
PDF
Why and How to Use Virtual DOM
PDF
CouchDB
PPTX
Top 8 Improvements in Drupal 8
PDF
Doctrine Php Object Relational Mapper
PDF
Drupal 6 to 7 migration guide
PPT
Introduction to Module Development (Drupal 7)
PDF
Gradle ex-machina
PDF
N hidden gems in forge (as of may '17)
PPTX
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
PDF
Drupal upgrades and migrations. BAD Camp 2013 version
Nuvola: a tale of migration to AWS
Drupal Is Not Your Web Site
Everything You Need to Know About the Top Changes in Drupal 8
Mobile & Desktop Cache 2.0: How To Create A Scriptable Cache
Solid and Infrastructure as Code
Drupal is not your Website
Evolution of Drupal and the Drupal community
Conference Migrate to Drupal 8 by Leon Cros at Drupal Developer Days 2015 in ...
Device Synchronization with Javascript and PouchDB
Big query - Command line tools and Tips - (MOSG)
Why and How to Use Virtual DOM
CouchDB
Top 8 Improvements in Drupal 8
Doctrine Php Object Relational Mapper
Drupal 6 to 7 migration guide
Introduction to Module Development (Drupal 7)
Gradle ex-machina
N hidden gems in forge (as of may '17)
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
Drupal upgrades and migrations. BAD Camp 2013 version
Ad

Viewers also liked (20)

PDF
Content migration - CSV to Drupal 8
PDF
Drupal Camp Atlanta 2015 - No Code Content Migration
PPTX
Migrate in Drupal 8
PPT
PPTX
Content Migration to Drupal 8
PPTX
Drupal 8 migrate!
PPTX
Drupal content-migration
PDF
Effectively Engaging Stakeholders in Drupal Projects
PDF
Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...
PPTX
CMS Site Migration and Security Audit
PDF
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
PDF
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
PPTX
Audc 2013 5 online trends for association websites
PPTX
Build a Better Website. 5 Online Trends to Employ Now!
PDF
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
PDF
Open Source and Cloud Beyond tech
PPTX
Website Redesign and CMS Migrations - 2013 AMP Annual Meeting
PDF
Out With the Old, in With the Open-source: Brainshark's Complete CMS Migration
PDF
Better understanding your prospects, clients, stakeholders and end users usin...
PPSX
Agile Methodology - Data Migration v1.0
Content migration - CSV to Drupal 8
Drupal Camp Atlanta 2015 - No Code Content Migration
Migrate in Drupal 8
Content Migration to Drupal 8
Drupal 8 migrate!
Drupal content-migration
Effectively Engaging Stakeholders in Drupal Projects
Moving from a Static Site to a CMS or from one CMS to Another Without Losing ...
CMS Site Migration and Security Audit
Plone in the Cloud - an on-demand CMS hosted on Amazon EC2
Journey to the Center of Drupal: How I learned to build Drupal sites the ‘rig...
Audc 2013 5 online trends for association websites
Build a Better Website. 5 Online Trends to Employ Now!
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Open Source and Cloud Beyond tech
Website Redesign and CMS Migrations - 2013 AMP Annual Meeting
Out With the Old, in With the Open-source: Brainshark's Complete CMS Migration
Better understanding your prospects, clients, stakeholders and end users usin...
Agile Methodology - Data Migration v1.0
Ad

Similar to Migrating to Drupal 8: How to Migrate Your Content and Minimize the Risks (20)

PDF
Migrating data to Drupal 8
PPT
PPPA D8 presentation Drupal For Gov_0
PDF
Drupal migrations in 2018 - presentation at DrupalCon in Nashville
PDF
Migrate all the things!
PDF
Drupal migrate-june2015
PDF
Migrate for Site Builders from MidCamp 2016
PDF
Drupal Migrations in 2018
PPTX
The long and the short of migrating to Drupal
PDF
MIGRATION - PAIN OR GAIN?
PDF
Intro to Drupal Migrate for Site Builders
PPTX
Migration to drupal 8.
PDF
Upgrades and migrations
PPTX
Drupal migrations in 2018 - SFDUG, March 8, 2018
PDF
[Srijan Wednesday Webinars] Simplifying Migration to Drupal 8
PDF
How to Migrate Drupal 6 to Drupal 8?
PPT
Taking your site from Drupal 6 to Drupal 7
PDF
Migrate 140123161042-phpapp02
PDF
Migrate
PPTX
Drupal 6 to Drupal 8 Migration
PPTX
Drupalcampchicago2010.rachel.datamigration.
Migrating data to Drupal 8
PPPA D8 presentation Drupal For Gov_0
Drupal migrations in 2018 - presentation at DrupalCon in Nashville
Migrate all the things!
Drupal migrate-june2015
Migrate for Site Builders from MidCamp 2016
Drupal Migrations in 2018
The long and the short of migrating to Drupal
MIGRATION - PAIN OR GAIN?
Intro to Drupal Migrate for Site Builders
Migration to drupal 8.
Upgrades and migrations
Drupal migrations in 2018 - SFDUG, March 8, 2018
[Srijan Wednesday Webinars] Simplifying Migration to Drupal 8
How to Migrate Drupal 6 to Drupal 8?
Taking your site from Drupal 6 to Drupal 7
Migrate 140123161042-phpapp02
Migrate
Drupal 6 to Drupal 8 Migration
Drupalcampchicago2010.rachel.datamigration.

More from Acquia (20)

PDF
Acquia_Adcetera Webinar_Marketing Automation.pdf
PDF
Acquia Webinar Deck - 9_13 .pdf
PDF
Taking Your Multi-Site Management at Scale to the Next Level
PDF
CDP for Retail Webinar with Appnovation - Q2 2022.pdf
PDF
May Partner Bootcamp 2022
PDF
April Partner Bootcamp 2022
PDF
How to Unify Brand Experience: A Hootsuite Story
PDF
Using Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CX
PDF
Improve Code Quality and Time to Market: 100% Cloud-Based Development Workflow
PDF
September Partner Bootcamp
PDF
August partner bootcamp
PDF
July 2021 Partner Bootcamp
PDF
May Partner Bootcamp
PDF
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
PDF
Work While You Sleep: The CMO’s Guide to a 24/7/365 Lead Machine
PDF
Acquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B Leads
PDF
April partner bootcamp deck cookieless future
PDF
How to enhance cx through personalised, automated solutions
PDF
DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...
PDF
Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021
Acquia_Adcetera Webinar_Marketing Automation.pdf
Acquia Webinar Deck - 9_13 .pdf
Taking Your Multi-Site Management at Scale to the Next Level
CDP for Retail Webinar with Appnovation - Q2 2022.pdf
May Partner Bootcamp 2022
April Partner Bootcamp 2022
How to Unify Brand Experience: A Hootsuite Story
Using Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CX
Improve Code Quality and Time to Market: 100% Cloud-Based Development Workflow
September Partner Bootcamp
August partner bootcamp
July 2021 Partner Bootcamp
May Partner Bootcamp
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
Work While You Sleep: The CMO’s Guide to a 24/7/365 Lead Machine
Acquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B Leads
April partner bootcamp deck cookieless future
How to enhance cx through personalised, automated solutions
DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...
Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Cloud computing and distributed systems.
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Monthly Chronicles - July 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Encapsulation theory and applications.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Cloud computing and distributed systems.

Migrating to Drupal 8: How to Migrate Your Content and Minimize the Risks

  • 1. Migrating to Drupal 8 How to Migrate Your Content and Minimize the Risks Acquia Webinar, 11-May-2015
  • 2. The 5 phases of migration → Auditing the source site → Planning the new data model → Prepping for migration → Planning the migration → Launching the migration
  • 3. Phase 1: Source site audit Taxes? Nope, understand your beginnings.
  • 4. Know your source site Primary for a smooth migration: → What does my site contain? (data structures) → What does my site use? (contrib and custom modules) → What does my site look like? (contrib or custom themes)
  • 5. Simple or Complex Questions to ask yourself: → Are you looking to essentially migrate everything? → How complex do you believe your site to be? → Do you have time to try a basic and direct migration? → Do you have cleanup you wish to perform?
  • 6. Data structure: bundles, fields, entities → Content types → Fields (migrate_tools’ migrate-fields-source Drush commands can help with this) → Menus → Vocabularies → Taxonomy terms → Users
  • 8. Features/Modules → Advanced search ▪ i.e. Search API + Search API Solr + Acquia Search → External Authentication ▪ SimpleSAMLphp, LDAP, OAuth → Rebuilding views used in D6 or D7 ▪ Manual process ▪ Missing contrib modules? → Commonly used modules: ▪ Pathauto, Redirect, Purge, et cetera. → Simple Sitemap module to generate Sitemap.xml file
  • 9. Are the contrib modules required for your site available yet on D8? → Check out Drupal 8 Contrib Porting Tracker ▪ https://www.drupal.org/project/contrib_tracker
  • 10. More Questions → Are the skills available to rewrite custom modules? → Are those custom modules still necessary or does D8 introduce better solutions in Core or Contrib? → Is there a cutover window? → Is new content being added and are site alterations being made while the site content is being migrated?
  • 11. Discuss some of the challenges → Learning D8 ▪ We started assembling module building lessons: • https://docs.acquia.com/articles/building-drupal-8-modules → Find skilled assistance to fill skill gaps → Identify impacted stakeholders ▪ Including stakeholders in the launch and post- launch process ▪ Insuring they are there to test. ▪ Insuring continued buy-in and collaboration
  • 12. Phase 2: Data model planning Congrats! You’ve chosen a complex migration/cleanup
  • 13. Plan, consult, resolve, goto 10 10 Plan out what content you expect to see 20 Consult with interested parties [time boxed] 30 Resolve any issues in your model 40 goto 10
  • 14. What’s in a name? When building it’s important to communicate as much as possible, as concisely as possible with structure. → i.e. Authors: field_article_author became field_authors → i.e. Drupal Projects: field_terms_project became field_projects_drupal Often there isn’t a single right answer, consistency is key.
  • 15. Issues we encountered 1. Typos and misspellings in source 2. Merging fields 3. Processing fields
  • 16. Review Date (date-time) → field_date_review → field_review_date (content type A) ▪ date → field_revew_date (content type B) ▪ date-time ▪ required using hours:minutes + date ▪ possible bug requiring fix? Trouble merging two similar fields
  • 17. Simple wins 1. Coordinating the machine names 2. Type and spelling fixes in machine names 3. Opportunity to change data-type
  • 18. Phase 3 - Migration prep or: How We Learned to Stop Worrying and Love the Migrate API
  • 20. A quick overview of contrib modules Module Description migrate_upgrade Drush commands for running upgrades from Drupal 6 or 7 to Drupal 8 migrate_tools General-purpose Drush commands and basic UI for managing migrations migrate_plus Extends the core migration framework with additional functionality (e.g. migration from XML and JSON sources) migrate_ui UI on top of Migration entities in core migrate_manifest Drush command for running template-based SQL migrations from a manifest file
  • 21. Dataset and data model, please. → Are we migrating one thousand or one million items? → Do you have any data model change? → Migrating via the UI is almost never a good solution ▪ Doesn’t allow for custom migrations ▪ Drush scales better ▪ Contrib has powerful and flexible Drush commands
  • 22. Get started with migration modules $ drush @site.env en -y migrate_drupal, migrate_upgrade, migrate_tools The following extensions will be enabled: migrate_drupal, migrate_upgrade, migrate_tools, migrate, migrate_plus → Use branch 8.x-2.x for all migration modules → Get the DB connection settings for the source site → Get familiar with the new Drush migration commands $ drush | grep migrate
  • 23. Configure your initial migration $ drush @site.env migrate-upgrade --legacy-db-url=mysql:// {USER}:{PASSWORD}@{HOST}:{PORT}/{DB} --legacy-root={URI} -- configure-only → All necessary YAML files should now be exported → Audit with Drush Configuration Management commands $ drush config-list | grep -c migrate 62
  • 24. Confirm your migration key is set >>> Drupal::>>> Drupal::state()->get('migrate_drupal_6'); => [ "key" => "upgrade", "database" => [ "driver" => "mysql", "username" => "{USER}", "password" => "{PASSWORD}", "host" => "{HOST}", "port" => "{PORT}", "database" => "{DB}", "prefix" => null, ], ]
  • 25. Run a full migration $ drush @site.env migrate-upgrade --legacy-db-url=mysql:// {USER}:{PASSWORD}@{HOST}:{PORT}/{DB} --legacy-root={URI} → Straightforward migration...but not extremely flexible → You probably need control at all levels of the migration → Enter the migrate-import Drush command
  • 26. Create a custom module (it’s easy!) → Create your *.info.yml file → Add your exported migration files to config/install → Enable your module. That’s it. $ drush @site.env config-export -y sync ; cp /path/to/config_dir/sync/migrate_plus.migration* /path/to/custom/module/config/install/
  • 27. Run a custom migration $ drush @site.env migrate-import --group=migrate_drupal_6 -- limit=10000 --feedback=1000 $ drush @site.env migrate-import d6_url_alias,d6_block, d6_file, d6_user,{...} --limit=10000 --feedback=1000 → Use --limit to limit on the number of items to process → Use --feedback to be notified of progress → You can even arbitrarily restrict by source plugin
  • 28. Migration status and messages $ drush @site.env migrate-status $ for i in upgrade_d6_node_type upgrade_d6_user {...} ; do drush @site.env migrate-messages $i ; done → Use migrate-status to have an overview of (last) imported, unprocessed and total number of items, etc. → Use migrate-messages to catch migration errors
  • 29. What about really custom migrations? → It still mostly is the Migrate you know and like ▪ prepareRow() ▪ query() ▪ ... → Extend default core Migrate source plugins → Write your own source Plugins
  • 30. Sample custom source Plugin <?php namespace Drupalmigrate_webinarPluginmigratesource; use DrupalpathPluginmigratesourced6UrlAlias; /** * @MigrateSource( * id = "webinar_d6_url_alias" * ) */ class WebinarUrlAlias extends UrlAlias { public function query() { $query = parent::query(); $query->condition('src', 'user/%', 'NOT LIKE'); return $query; } } Core source Plugin Plugin annotation Custom logic via the query() method
  • 31. Migration tips and tricks → The Migration API is still in flux. Check drupal.org! ▪ Major changes in Drupal 8.1.x - Check http: //mikeryan.name/blog/mikeryan/migration- update-for-drupal-8-1 → See a d6 or d7 string in a migration filename? ▪ It’s specific to this Drupal version ▪ If you don’t see anything, it works for both → Start backwards with custom migrations ▪ Use a minimalistic set of migration files first ▪ Add the required dependencies as you go
  • 32. Phase 4: Migration planning & strategy The devil is in the...
  • 33. Stages of migration 1. Initial development - Used Dev and Test 2. Working through the migration bugs 3. Prepping prod (check and triple check) 4. Code “almost ready” - test migration manually 5. Switch to continuous content migration (failed) ▪ dev for active migration work ▪ stage for QA ▪ prod for lead up to launch 6. Test until your eyes and fingers bleed (joke, !joke)
  • 34. Why continuous content migration → This allows code fixes to be rolled into place until very shortly (48 hours) before launch. → Why did we fail? ▪ Tokens in content ▪ Most in place but some had to be manually moved → Result -> migration was semi-continuous but we needed longer window for move (one week). ▪ If “no-go called” -> redo the manual migration ▪ Generated pressure
  • 35. Continuous migration of content $ ssh -i /home/{USERNAME}/{SSH_KEY} -f -L 1111:{DB_SERVER}:3306 {USER}@{WEB_SERVER} -N → Can you afford a hard cutover/downtime? → Use SSH tunneling for maximum security → https://docs.acquia.com/articles/ssh-tunneling-server- side-applications
  • 36. Now’s your chance Take the migration to D8 as an opportunity to get rid of bad old habits! → PHP filter → Full HTML → Improve editorial Workflow ▪ Multiversion (must be in place prior to migration) ▪ Workbench Moderation However, Don’t fall down the rabbit hole!
  • 37. Phase 5: Launch Where the rubber meets the road!
  • 38. Plan for go/no-go decision → This is probably one of the hardest processes to plan. → Complete buy-in from stakeholders is needed. → Clearly record and communicate. → Set a reasonable and firm timeline. → Set the conditions for why to delay. → If possible stick to the timeline when launching. → Try to mitigate risk where possible ▪ sometimes this means delaying a launch ▪ sometimes this means going and fixing post launch
  • 39. Our plan: what worked → Content Freeze → Window for migration → Focusing on content as the priority → Iterative development with Minimal Viable Product ▪ identifying key needs ▪ addressing non-critical path issues after launch → Replaced a lot of older code just by using D8 core
  • 40. Our plan: what didn’t work → Misaligned expectations ▪ incomplete go/no-go plan → Working against a hard deadline (Drupal 6 EOL) → Not enough time planned for encountering bugs in custom migration → Missing contrib modules → Finding time to contribute to porting modules
  • 41. Ensure assets consistency mysql> SELECT COUNT(fid) FROM file_managed; $ find . ! -path "*styles*" ! -path "*ctools*" ! -path "*css*" ! -path "*js*" ! -path "*xmlsitemap*" -type f | wc -l $ rsync -avz --progress --exclude=styles --exclude=ctools -- exclude=css --exclude=js --exclude=xmlsitemap -e "ssh -i /home/ {USERNAME}/.ssh/id_rsa" {SOURCE_SERVER}:{SOURCE_PATH} . → Not all files are necessarily managed by Drupal → Use rsync when the Migrate API can’t help
  • 42. We hope you learned about... 1. How to audit: bundles, fields, and entities 2. Planning steps: stay, go, and modify 3. Migrate API and contrib migration modules 4. Process: near-continuous migration of content to minimize downtime 5. Effectively creating, implementing a risk mitigation plan
  • 43. Thank You - Questions?