狠狠撸

狠狠撸Share a Scribd company logo
Upgrades and Migrations 
Yaron Tal 
20-nov-2014
About me 
● Yaron Tal 
● Drupal backend developer 
@oneshoe 
● Multiple big migrations 
● http://ytal.nl
What do you migrate and 
upgrade? 
● Tests 
● Functionality 
● Front?end 
● Back?end 
● Content 
● Migrate module
Tests 
● Test plans 
● Unit tests, behat, … 
● Documentation
Upgrade: Front?end 
https://www.drupal.org/update/themes/6/7 
● New jQuery 
● SASS? 
● Twig in D8
Upgrade: Back?end 
https://www.drupal.org/update/modules/6/7 
● Module upgrader 
(https://www.drupal.org/project/drupalmoduleupgrader) 
● Coder 
● Field API, DB API, 
hooks, views API, ...
Upgrade: Backend Example 
Drupal 6 
foreach ($properties as $property) { 
$i++; 
$joins[] = 'JOIN $property['table'] . 'p' . $i . ' ON n.nid=p' . $i . '.nid'; 
$select[] = 'p' . $i . $property['column']; 
} 
$query = 'SELECT ' . implode(', ', $select) . ' FROM {node} n ' . implode(' ', $joins); 
Drupal 7 
$query = db_select('node', 'n'); 
foreach ($properties as $property) { 
$alias = $query?> 
join($property['table'], 'p', 'n.nid=p.nid'); 
$query?> 
addField($alias, $property['column']); 
}
Content 
● Migrate module 
(https://www.drupal.org/project/migrate) 
● D2D migrate 
(https://www.drupal.org/project/migrate_d2d) 
● Other modules for 
other sources
Migrate module 
● OOP 
● Migration classes 
● Source classes 
● Destination classes 
● Drush
Migrate module: Mapping 
● Node 
● File 
● Taxonomy 
● Users 
● Custom entity
Migrate module: Inline media 
libraries_load('simplehtmldom') 
$html = str_get_html($text); 
foreach ($html?> 
find('img') as $image) { 
} 
● Media module 
(https://www.drupal.org/project/media) 
● Youtube/vimeo/...
Migrate module: Inline links 
libraries_load('simplehtmldom') 
$html = str_get_html($text); 
foreach ($html?> 
find('a') as $link) { 
} 
● Aliases, redirects, node table. 
● New version of node might not 
exist.
Migrate module: advanced 
● Stubs 
● Continuous migrations (Highwater) 
● $this?> 
systemOfRecord = Migration::DESTINATION;
Conclusion 
● Upgrade tests and documentation 
● Upgrade theme and modules using the module 
upgrader 
● Check code with coder module 
● Migrate content using migrate module and helper 
module for specific source 
● Use an html parser to find images, links and other 
html elements that need changing
Questions?

More Related Content

Similar to Migrations (20)

PDF
Drupal upgrades and migrations. BAD Camp 2013 version
David Lanier
?
PPTX
Drupal 6 to Drupal 8 Migration
Ameex Technologies
?
PDF
How to Migrate Drupal 6 to Drupal 8?
DrupalGeeks
?
PDF
Migrating to Drupal 8: How to Migrate Your Content and Minimize the Risks
Acquia
?
PPT
Taking your site from Drupal 6 to Drupal 7
Phase2
?
PPT
PPPA D8 presentation Drupal For Gov_0
Stan Ascher
?
PDF
Tools to Upgrade to Drupal 8
DrupalGeeks
?
PDF
Migrating data to Drupal 8
F.L. Jonathan Ara?a Cruz
?
PDF
Migrate
cherryhillco
?
PDF
Upgrades and migrations
David Lanier
?
PPTX
Drupal Migration
永对 陈
?
PPT
Dcm migration
Piyuesh Kumar
?
PDF
[Srijan Wednesday Webinars] Simplifying Migration to Drupal 8
Srijan Technologies
?
PDF
Migrate 140123161042-phpapp02
Gaurav Varshney
?
PDF
Drupal migrate-june2015
Suzanne Dergacheva
?
PDF
Migrate to Drupal 8
Claudiu Cristea
?
PDF
Migrating data into Drupal using the migrate module
Johan Gant
?
PDF
Migrate for Site Builders from MidCamp 2016
Suzanne Dergacheva
?
PDF
Migrating to Drupal 8
Alkuvoima
?
PDF
Drupal 8 update: May 2014. Migrate in core.
Vladimir Roudakov
?
Drupal upgrades and migrations. BAD Camp 2013 version
David Lanier
?
Drupal 6 to Drupal 8 Migration
Ameex Technologies
?
How to Migrate Drupal 6 to Drupal 8?
DrupalGeeks
?
Migrating to Drupal 8: How to Migrate Your Content and Minimize the Risks
Acquia
?
Taking your site from Drupal 6 to Drupal 7
Phase2
?
PPPA D8 presentation Drupal For Gov_0
Stan Ascher
?
Tools to Upgrade to Drupal 8
DrupalGeeks
?
Migrating data to Drupal 8
F.L. Jonathan Ara?a Cruz
?
Migrate
cherryhillco
?
Upgrades and migrations
David Lanier
?
Drupal Migration
永对 陈
?
Dcm migration
Piyuesh Kumar
?
[Srijan Wednesday Webinars] Simplifying Migration to Drupal 8
Srijan Technologies
?
Migrate 140123161042-phpapp02
Gaurav Varshney
?
Drupal migrate-june2015
Suzanne Dergacheva
?
Migrate to Drupal 8
Claudiu Cristea
?
Migrating data into Drupal using the migrate module
Johan Gant
?
Migrate for Site Builders from MidCamp 2016
Suzanne Dergacheva
?
Migrating to Drupal 8
Alkuvoima
?
Drupal 8 update: May 2014. Migrate in core.
Vladimir Roudakov
?

Recently uploaded (20)

PDF
Materi tentang From Digital Economy to Fintech.pdf
Abdul Hakim
?
PPTX
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
?
PDF
The Convergence of Threat Behaviors Across Intrusions
Joe Slowik
?
PPTX
Lesson 1.1 Career-Opportunities-in-Ict.pptx
lizelgumadlas1
?
PDF
web application development company in bangalore.pdf
https://dkpractice.co.in/seo.html tech
?
PPTX
美国电子毕业证帕克大学电子版成绩单鲍惭颁笔学费发票办理学历认证
Taqyea
?
PPTX
原版一样(毕业证书)法国蒙彼利埃大学毕业证文凭复刻
Taqyea
?
PDF
Learning Exemplar_Technology and Livelihood Education 7 Q1_W2.pdf
mjhiludo16
?
PDF
AI security AI security AI security AI security
elite44
?
PDF
Beginning-Laravel-Build-Websites-with-Laravel-5.8-by-Sanjib-Sinha-z-lib.org.pdf
TagumLibuganonRiverB
?
PPTX
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
?
PDF
google promotion services in Delhi, India
Digital Web Future
?
PDF
ContextForge MCP Gateway - the missing proxy for AI Agents and Tools
Mihai Criveti
?
PDF
Empowering Local Language Email with IDN & EAI – Powered by XgenPlus
XgenPlus Technologies
?
PPTX
Ransomware attack and its effects on cyber crimes
ShilpaShreeD
?
PPTX
Class_4_Limbgvchgchgchgchgchgcjhgchgcnked_Lists.pptx
test123n
?
PDF
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
?
PPTX
CHAPTER 1 - PART 3 FOR GRADE 11 STUDENTS
FSBTLEDNathanVince
?
PPTX
Introduction-to-the-AWS-Solution-Architect.pptx
Prince391830
?
PDF
The Hidden Benefits of Outsourcing IT Hardware Procurement for Small Businesses
Carley Cramer
?
Materi tentang From Digital Economy to Fintech.pdf
Abdul Hakim
?
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
?
The Convergence of Threat Behaviors Across Intrusions
Joe Slowik
?
Lesson 1.1 Career-Opportunities-in-Ict.pptx
lizelgumadlas1
?
web application development company in bangalore.pdf
https://dkpractice.co.in/seo.html tech
?
美国电子毕业证帕克大学电子版成绩单鲍惭颁笔学费发票办理学历认证
Taqyea
?
原版一样(毕业证书)法国蒙彼利埃大学毕业证文凭复刻
Taqyea
?
Learning Exemplar_Technology and Livelihood Education 7 Q1_W2.pdf
mjhiludo16
?
AI security AI security AI security AI security
elite44
?
Beginning-Laravel-Build-Websites-with-Laravel-5.8-by-Sanjib-Sinha-z-lib.org.pdf
TagumLibuganonRiverB
?
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
?
google promotion services in Delhi, India
Digital Web Future
?
ContextForge MCP Gateway - the missing proxy for AI Agents and Tools
Mihai Criveti
?
Empowering Local Language Email with IDN & EAI – Powered by XgenPlus
XgenPlus Technologies
?
Ransomware attack and its effects on cyber crimes
ShilpaShreeD
?
Class_4_Limbgvchgchgchgchgchgcjhgchgcnked_Lists.pptx
test123n
?
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
?
CHAPTER 1 - PART 3 FOR GRADE 11 STUDENTS
FSBTLEDNathanVince
?
Introduction-to-the-AWS-Solution-Architect.pptx
Prince391830
?
The Hidden Benefits of Outsourcing IT Hardware Procurement for Small Businesses
Carley Cramer
?
Ad

Migrations

  • 1. Upgrades and Migrations Yaron Tal 20-nov-2014
  • 2. About me ● Yaron Tal ● Drupal backend developer @oneshoe ● Multiple big migrations ● http://ytal.nl
  • 3. What do you migrate and upgrade? ● Tests ● Functionality ● Front?end ● Back?end ● Content ● Migrate module
  • 4. Tests ● Test plans ● Unit tests, behat, … ● Documentation
  • 5. Upgrade: Front?end https://www.drupal.org/update/themes/6/7 ● New jQuery ● SASS? ● Twig in D8
  • 6. Upgrade: Back?end https://www.drupal.org/update/modules/6/7 ● Module upgrader (https://www.drupal.org/project/drupalmoduleupgrader) ● Coder ● Field API, DB API, hooks, views API, ...
  • 7. Upgrade: Backend Example Drupal 6 foreach ($properties as $property) { $i++; $joins[] = 'JOIN $property['table'] . 'p' . $i . ' ON n.nid=p' . $i . '.nid'; $select[] = 'p' . $i . $property['column']; } $query = 'SELECT ' . implode(', ', $select) . ' FROM {node} n ' . implode(' ', $joins); Drupal 7 $query = db_select('node', 'n'); foreach ($properties as $property) { $alias = $query?> join($property['table'], 'p', 'n.nid=p.nid'); $query?> addField($alias, $property['column']); }
  • 8. Content ● Migrate module (https://www.drupal.org/project/migrate) ● D2D migrate (https://www.drupal.org/project/migrate_d2d) ● Other modules for other sources
  • 9. Migrate module ● OOP ● Migration classes ● Source classes ● Destination classes ● Drush
  • 10. Migrate module: Mapping ● Node ● File ● Taxonomy ● Users ● Custom entity
  • 11. Migrate module: Inline media libraries_load('simplehtmldom') $html = str_get_html($text); foreach ($html?> find('img') as $image) { } ● Media module (https://www.drupal.org/project/media) ● Youtube/vimeo/...
  • 12. Migrate module: Inline links libraries_load('simplehtmldom') $html = str_get_html($text); foreach ($html?> find('a') as $link) { } ● Aliases, redirects, node table. ● New version of node might not exist.
  • 13. Migrate module: advanced ● Stubs ● Continuous migrations (Highwater) ● $this?> systemOfRecord = Migration::DESTINATION;
  • 14. Conclusion ● Upgrade tests and documentation ● Upgrade theme and modules using the module upgrader ● Check code with coder module ● Migrate content using migrate module and helper module for specific source ● Use an html parser to find images, links and other html elements that need changing

Editor's Notes

  • #14: Stubs to make node exist to be able to link to it Highwater to update in parts/continuous. System of record to update parts instead of create or update the whole record