SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
Magento 2 Upgrade Scope
Database
Schema
Data
Codebase
Magento framework
3rd party extensions
Custom modules
Custom themes
@SergiiShymko #mm16it
Magento 2 Upgrade Tooling
Database
Schema
Data
Codebase
Magento framework
3rd party extensions
Custom modules
Custom themes
Data migration tool
github.com/magento/data-migration-tool
Code migration tool
github.com/magento/code-migration
@SergiiShymko #mm16it
Code Migration Tool Scope
Directory
structure
Configuration
<?php // code ;)
Layout
Magento
module
@SergiiShymko #mm16it
Code Migration Tool Overview
• Audience: Magento developers
• Interface: Command line interface (CLI)
• Goal: Automate routine code changes
• Methodology: Static code analysis
Code migration tool
@SergiiShymko #mm16it
Magento 1.x
source code
Magento 2
source code
Prerequisite Directory Structure
@SergiiShymko #mm16it
<tool> – Installed M2 code migration tool
<src> – Custom M1 code to be migrated
<dst> – Empty directory to put generated M2 code to
<m1> – Vanilla M1 codebase + Custom M1 code (<src>)
<m2> – Vanilla M2 codebase
Directories Utilization
Code migration tool
@SergiiShymko #mm16it
<src> <dst>
<m1> <m2>
Directories Utilization
Code migration tool
@SergiiShymko #mm16it
<src> <dst>
<m1> <m2>
Migration Sequence
Generate
mappings
Migrate
directory
structure
Migrate
layout
Migrate
config
Migrate
PHP code
1. 2. 3. 4. 5.
@SergiiShymko #mm16it
Command to run:
1. Mapping Generation
• Mapping between:
– Latest M1 and M2 releases – out of the box
– Any M1 and M2 versions – generated on demand
• Mapping covers:
– Module names
– Class names & dependencies
– Table names
– View files
@SergiiShymko #mm16it
php <tool>/bin/utils.php generateClassMapping <m1> <m2>
Command to run:
2. Directory Structure Migration
• Removal of code pools (core, community, local)
• Aggregation of module’s files in a single directory:
– PHP code
– Templates
– Layouts
– Static assets
– Translation dictionaries
@SergiiShymko #mm16it
php <tool>/bin/migrate.php migrateModuleStructure <src> <dst>
Magento 1.x Magento 2
app/
code/
community/
Example/Module/
etc/modules/
locale/<locale>/
design/
<area>/base/default/
skin/
<area>/base/default/
app/
code/
Example/Module/
etc/
i18n/<locale>/
view/<area>/
2. Directory Structure Migration
@SergiiShymko #mm16it
Command to run:
3. Layout Migration
• Breaking down layout files by handles
• Format of layout XML files:
– Block types
– Block names
– Template references
– References to blocks and containers
– Adding JS/CSS assets to page head
@SergiiShymko #mm16it
php <tool>/bin/migrate.php convertLayout <dst>
Magento 1.x Magento 2
app/
design/
frontend/
base/default/
layout/
example.xml
app/
code/
Example/Module/
view/
frontend/
layout/
default.xml
…
3. Layout Migration
@SergiiShymko #mm16it
Command to run:
4. Configuration Migration
• Breaking down config.xml into granular configs
• Format of config XML files:
– Module declaration
– Routers
– Indexers
– Admin menu
– System configuration
– Widgets
@SergiiShymko #mm16it
php <tool>/bin/migrate.php convertConfig <dst>
Magento 1.x Magento 2
app/
code/community/
Example/Module/
etc/
config.xml
app/
code/
Example/Module/
etc/[<area>/]
module.xml
…
4. Configuration Migration
…
@SergiiShymko #mm16it
Command to run:
5. PHP Code Migration
• Breaking down controllers by actions
• Format of PHP files:
– Class namespaces
– Dependency injection via constructor
– Class name aliases in factory methods
– Class names in static calls, constants, arguments, operator “new”, PHPDoc
– Table name aliases
– Translation via “gettext”
@SergiiShymko #mm16it
php <tool>/bin/migrate.php convertPhpCode <dst> <m1> <m2>
5. PHP Code Migration
@SergiiShymko #mm16it
Tool Commands Summary
1. Generate mappings
2. Migrate directory structure
3. Migrate layout
4. Migrate configuration
5. Migrate PHP code
php <tool>/bin/migrate.php migrateModuleStructure <src> <dst>
php <tool>/bin/migrate.php convertLayout <dst>
php <tool>/bin/migrate.php convertConfig <dst>
php <tool>/bin/migrate.php convertPhpCode <dst> <m1> <m2>
php <tool>/bin/utils.php generateClassMapping <m1> <m2>
@SergiiShymko #mm16it
a. Commit disabled M2 modules
b. Test, fix, and enable module by module
3. M2 codebase tasks
Upgrade Project Breakdown
2. Code migration tool tasks
a. Tailor the tool for patterns unique to the project
b. Run the tool against M1 codebase
1. M1 codebase tasks
a. Remove unused modules
b. Remove fixes of M1 bugs irrelevant in M2
@SergiiShymko #mm16it
Sergii Shymko
sshymko@magento.com
sergey@shymko.net
github.com/magento/code-migration
github.com/magento/data-migration-tool
devdocs.magento.com/guides/v2.0/migration/migration-tool.html
Thank You!
Q & A

Contenu connexe

Tendances

Imagine recap-devhub
Imagine recap-devhubImagine recap-devhub
Imagine recap-devhub
Magento Dev
 

Tendances (20)

Magento 2 Development for PHP Developers
Magento 2 Development for PHP DevelopersMagento 2 Development for PHP Developers
Magento 2 Development for PHP Developers
 
Imagine recap-devhub
Imagine recap-devhubImagine recap-devhub
Imagine recap-devhub
 
How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2
 
Outlook on Magento 2
Outlook on Magento 2Outlook on Magento 2
Outlook on Magento 2
 
How to migrate from Magento 1 to Magento 2
How to migrate from Magento 1 to Magento 2How to migrate from Magento 1 to Magento 2
How to migrate from Magento 1 to Magento 2
 
Meet Magento Belarus - Elena Leonova
Meet Magento Belarus - Elena LeonovaMeet Magento Belarus - Elena Leonova
Meet Magento Belarus - Elena Leonova
 
Magento 2 Development Best Practices
Magento 2 Development Best PracticesMagento 2 Development Best Practices
Magento 2 Development Best Practices
 
Migrating from Magento 1 to Magento 2
Migrating from Magento 1 to Magento 2Migrating from Magento 1 to Magento 2
Migrating from Magento 1 to Magento 2
 
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
 
Magento 2 Modules are Easy!
Magento 2 Modules are Easy!Magento 2 Modules are Easy!
Magento 2 Modules are Easy!
 
Federico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento VersionFederico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento Version
 
Magento 2 Design Patterns
Magento 2 Design PatternsMagento 2 Design Patterns
Magento 2 Design Patterns
 
Meet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey IvashchenkoMeet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey Ivashchenko
 
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarks
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarksMagento 2 Seminar - Daniel Genis - Magento 2 benchmarks
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarks
 
Oleh Kobchenko - Configure Magento 2 to get maximum performance
Oleh Kobchenko - Configure Magento 2 to get maximum performanceOleh Kobchenko - Configure Magento 2 to get maximum performance
Oleh Kobchenko - Configure Magento 2 to get maximum performance
 
Magento 1.x to Magento 2 Code Migration Tools
Magento 1.x to Magento 2 Code Migration ToolsMagento 1.x to Magento 2 Code Migration Tools
Magento 1.x to Magento 2 Code Migration Tools
 
Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...
Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...
Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...
 
Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015
 
How To Create Theme in Magento 2 - Part 1
How To Create Theme in Magento 2 - Part 1How To Create Theme in Magento 2 - Part 1
How To Create Theme in Magento 2 - Part 1
 
Magento 2 Code Migration Tool
Magento 2 Code Migration ToolMagento 2 Code Migration Tool
Magento 2 Code Migration Tool
 

Similaire à Sergii Shymko - Code migration tool for upgrade to Magento 2

Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php framework
Bo-Yi Wu
 
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devsITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp
 
Maintainable Sitecore Solutions
Maintainable Sitecore SolutionsMaintainable Sitecore Solutions
Maintainable Sitecore Solutions
Thomas Eldblom
 

Similaire à Sergii Shymko - Code migration tool for upgrade to Magento 2 (20)

Kentico CMS 7 – Mobile web development
Kentico CMS 7 – Mobile web developmentKentico CMS 7 – Mobile web development
Kentico CMS 7 – Mobile web development
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend Development
 
Magento2 frontend development
Magento2   frontend developmentMagento2   frontend development
Magento2 frontend development
 
Magento
MagentoMagento
Magento
 
Front End Development in Magento
Front End Development in MagentoFront End Development in Magento
Front End Development in Magento
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php framework
 
Expert guidance on migrating from magento 1 to magento 2
Expert guidance on migrating from magento 1 to magento 2Expert guidance on migrating from magento 1 to magento 2
Expert guidance on migrating from magento 1 to magento 2
 
Макс Екатериненко - Meet Magento Ukraine - Magento 2 Overview
Макс Екатериненко - Meet Magento Ukraine - Magento 2 OverviewМакс Екатериненко - Meet Magento Ukraine - Magento 2 Overview
Макс Екатериненко - Meet Magento Ukraine - Magento 2 Overview
 
Porting Magento 1.x extensions to Magento 2
Porting Magento 1.x extensions to Magento 2Porting Magento 1.x extensions to Magento 2
Porting Magento 1.x extensions to Magento 2
 
Alfresco Records Management Tech Talk Live September 2015
Alfresco Records Management Tech Talk Live September 2015Alfresco Records Management Tech Talk Live September 2015
Alfresco Records Management Tech Talk Live September 2015
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devsITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
 
Magento 2 - Getting started.
Magento 2 - Getting started.Magento 2 - Getting started.
Magento 2 - Getting started.
 
Innovations in Sencha Tooling and Framework
Innovations in Sencha Tooling and FrameworkInnovations in Sencha Tooling and Framework
Innovations in Sencha Tooling and Framework
 
Uniface 10 IDE Under the Hood
Uniface 10 IDE Under the HoodUniface 10 IDE Under the Hood
Uniface 10 IDE Under the Hood
 
Yoav Kutner Dutchento
Yoav Kutner DutchentoYoav Kutner Dutchento
Yoav Kutner Dutchento
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
 
Maintainable Sitecore Solutions
Maintainable Sitecore SolutionsMaintainable Sitecore Solutions
Maintainable Sitecore Solutions
 
Codeignitor
Codeignitor Codeignitor
Codeignitor
 

Plus de Meet Magento Italy

Giulio Gargiullo - Strategie di marketing digitale per avviare l’e-commerce i...
Giulio Gargiullo - Strategie di marketing digitale per avviare l’e-commerce i...Giulio Gargiullo - Strategie di marketing digitale per avviare l’e-commerce i...
Giulio Gargiullo - Strategie di marketing digitale per avviare l’e-commerce i...
Meet Magento Italy
 

Plus de Meet Magento Italy (20)

Dirk Pinamonti - Come affrontare la sfida del nuovo mercato multicanale e del...
Dirk Pinamonti - Come affrontare la sfida del nuovo mercato multicanale e del...Dirk Pinamonti - Come affrontare la sfida del nuovo mercato multicanale e del...
Dirk Pinamonti - Come affrontare la sfida del nuovo mercato multicanale e del...
 
Vinai Kopp - How i develop M2 modules
Vinai Kopp - How i develop M2 modules Vinai Kopp - How i develop M2 modules
Vinai Kopp - How i develop M2 modules
 
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum PerformanceEugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
 
Muliadi jeo - How to sell online in Indonesia
Muliadi jeo - How to sell online in IndonesiaMuliadi jeo - How to sell online in Indonesia
Muliadi jeo - How to sell online in Indonesia
 
Max Pronko - 10 migration mistakes from Magento 1 to Magento 2
Max Pronko - 10 migration mistakes from Magento 1 to Magento 2Max Pronko - 10 migration mistakes from Magento 1 to Magento 2
Max Pronko - 10 migration mistakes from Magento 1 to Magento 2
 
Alessandro La Ciura - Progettare la migliore integrazione tra live chat ed e-...
Alessandro La Ciura - Progettare la migliore integrazione tra live chat ed e-...Alessandro La Ciura - Progettare la migliore integrazione tra live chat ed e-...
Alessandro La Ciura - Progettare la migliore integrazione tra live chat ed e-...
 
Bodin - Hullin & Potencier - Magento Performance Profiling and Best Practices
Bodin - Hullin & Potencier - Magento Performance Profiling and Best PracticesBodin - Hullin & Potencier - Magento Performance Profiling and Best Practices
Bodin - Hullin & Potencier - Magento Performance Profiling and Best Practices
 
Giulio Gargiullo - Strategie di marketing digitale per avviare l’e-commerce i...
Giulio Gargiullo - Strategie di marketing digitale per avviare l’e-commerce i...Giulio Gargiullo - Strategie di marketing digitale per avviare l’e-commerce i...
Giulio Gargiullo - Strategie di marketing digitale per avviare l’e-commerce i...
 
Vinai Kopp - FPC Hole punching in Magento 2
Vinai Kopp - FPC Hole punching in Magento 2Vinai Kopp - FPC Hole punching in Magento 2
Vinai Kopp - FPC Hole punching in Magento 2
 
Jacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
Jacopo Nardiello - From CI to Prod: Running Magento at scale with KubernetesJacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
Jacopo Nardiello - From CI to Prod: Running Magento at scale with Kubernetes
 
James Zetlen - PWA Studio Integration…With You
James Zetlen - PWA Studio Integration…With YouJames Zetlen - PWA Studio Integration…With You
James Zetlen - PWA Studio Integration…With You
 
Talesh Seeparsan - The Hound of the Malwarevilles
Talesh Seeparsan - The Hound of the MalwarevillesTalesh Seeparsan - The Hound of the Malwarevilles
Talesh Seeparsan - The Hound of the Malwarevilles
 
Miguel Balparda - A day in support
Miguel Balparda - A day in supportMiguel Balparda - A day in support
Miguel Balparda - A day in support
 
Volodymyr Kublytskyi - Develop Product, Design Platform
Volodymyr Kublytskyi - Develop Product, Design PlatformVolodymyr Kublytskyi - Develop Product, Design Platform
Volodymyr Kublytskyi - Develop Product, Design Platform
 
Rosario Toscano - Processi di ottimizzazione per una crescita continua
Rosario Toscano - Processi di ottimizzazione per una crescita continuaRosario Toscano - Processi di ottimizzazione per una crescita continua
Rosario Toscano - Processi di ottimizzazione per una crescita continua
 
Henrik Feld Jakobsen - How to sell online Scandinavia
Henrik Feld Jakobsen - How to sell online ScandinaviaHenrik Feld Jakobsen - How to sell online Scandinavia
Henrik Feld Jakobsen - How to sell online Scandinavia
 
Rabia Qureshi - How to sell online in UK
Rabia Qureshi - How to sell online in UKRabia Qureshi - How to sell online in UK
Rabia Qureshi - How to sell online in UK
 
Matteo Schuerch - How to sell online in Switzerland
Matteo Schuerch - How to sell online in SwitzerlandMatteo Schuerch - How to sell online in Switzerland
Matteo Schuerch - How to sell online in Switzerland
 
Il data-driven nell’e-commerce: il caso studio Alessi
Il data-driven nell’e-commerce: il caso studio AlessiIl data-driven nell’e-commerce: il caso studio Alessi
Il data-driven nell’e-commerce: il caso studio Alessi
 
Philippe Bernou - Seamless omnichannel solutions with Magento order management
Philippe Bernou - Seamless omnichannel solutions with Magento order managementPhilippe Bernou - Seamless omnichannel solutions with Magento order management
Philippe Bernou - Seamless omnichannel solutions with Magento order management
 

Dernier

No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
Sheetaleventcompany
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
raffaeleoman
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
amilabibi1
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
Kayode Fayemi
 

Dernier (20)

No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 

Sergii Shymko - Code migration tool for upgrade to Magento 2

  • 1.
  • 2.
  • 3. Magento 2 Upgrade Scope Database Schema Data Codebase Magento framework 3rd party extensions Custom modules Custom themes @SergiiShymko #mm16it
  • 4. Magento 2 Upgrade Tooling Database Schema Data Codebase Magento framework 3rd party extensions Custom modules Custom themes Data migration tool github.com/magento/data-migration-tool Code migration tool github.com/magento/code-migration @SergiiShymko #mm16it
  • 5. Code Migration Tool Scope Directory structure Configuration <?php // code ;) Layout Magento module @SergiiShymko #mm16it
  • 6. Code Migration Tool Overview • Audience: Magento developers • Interface: Command line interface (CLI) • Goal: Automate routine code changes • Methodology: Static code analysis Code migration tool @SergiiShymko #mm16it Magento 1.x source code Magento 2 source code
  • 7. Prerequisite Directory Structure @SergiiShymko #mm16it <tool> – Installed M2 code migration tool <src> – Custom M1 code to be migrated <dst> – Empty directory to put generated M2 code to <m1> – Vanilla M1 codebase + Custom M1 code (<src>) <m2> – Vanilla M2 codebase
  • 8. Directories Utilization Code migration tool @SergiiShymko #mm16it <src> <dst> <m1> <m2>
  • 9. Directories Utilization Code migration tool @SergiiShymko #mm16it <src> <dst> <m1> <m2>
  • 11. Command to run: 1. Mapping Generation • Mapping between: – Latest M1 and M2 releases – out of the box – Any M1 and M2 versions – generated on demand • Mapping covers: – Module names – Class names & dependencies – Table names – View files @SergiiShymko #mm16it php <tool>/bin/utils.php generateClassMapping <m1> <m2>
  • 12. Command to run: 2. Directory Structure Migration • Removal of code pools (core, community, local) • Aggregation of module’s files in a single directory: – PHP code – Templates – Layouts – Static assets – Translation dictionaries @SergiiShymko #mm16it php <tool>/bin/migrate.php migrateModuleStructure <src> <dst>
  • 13. Magento 1.x Magento 2 app/ code/ community/ Example/Module/ etc/modules/ locale/<locale>/ design/ <area>/base/default/ skin/ <area>/base/default/ app/ code/ Example/Module/ etc/ i18n/<locale>/ view/<area>/ 2. Directory Structure Migration @SergiiShymko #mm16it
  • 14. Command to run: 3. Layout Migration • Breaking down layout files by handles • Format of layout XML files: – Block types – Block names – Template references – References to blocks and containers – Adding JS/CSS assets to page head @SergiiShymko #mm16it php <tool>/bin/migrate.php convertLayout <dst>
  • 15. Magento 1.x Magento 2 app/ design/ frontend/ base/default/ layout/ example.xml app/ code/ Example/Module/ view/ frontend/ layout/ default.xml … 3. Layout Migration @SergiiShymko #mm16it
  • 16. Command to run: 4. Configuration Migration • Breaking down config.xml into granular configs • Format of config XML files: – Module declaration – Routers – Indexers – Admin menu – System configuration – Widgets @SergiiShymko #mm16it php <tool>/bin/migrate.php convertConfig <dst>
  • 17. Magento 1.x Magento 2 app/ code/community/ Example/Module/ etc/ config.xml app/ code/ Example/Module/ etc/[<area>/] module.xml … 4. Configuration Migration … @SergiiShymko #mm16it
  • 18. Command to run: 5. PHP Code Migration • Breaking down controllers by actions • Format of PHP files: – Class namespaces – Dependency injection via constructor – Class name aliases in factory methods – Class names in static calls, constants, arguments, operator “new”, PHPDoc – Table name aliases – Translation via “gettext” @SergiiShymko #mm16it php <tool>/bin/migrate.php convertPhpCode <dst> <m1> <m2>
  • 19. 5. PHP Code Migration @SergiiShymko #mm16it
  • 20. Tool Commands Summary 1. Generate mappings 2. Migrate directory structure 3. Migrate layout 4. Migrate configuration 5. Migrate PHP code php <tool>/bin/migrate.php migrateModuleStructure <src> <dst> php <tool>/bin/migrate.php convertLayout <dst> php <tool>/bin/migrate.php convertConfig <dst> php <tool>/bin/migrate.php convertPhpCode <dst> <m1> <m2> php <tool>/bin/utils.php generateClassMapping <m1> <m2> @SergiiShymko #mm16it
  • 21. a. Commit disabled M2 modules b. Test, fix, and enable module by module 3. M2 codebase tasks Upgrade Project Breakdown 2. Code migration tool tasks a. Tailor the tool for patterns unique to the project b. Run the tool against M1 codebase 1. M1 codebase tasks a. Remove unused modules b. Remove fixes of M1 bugs irrelevant in M2 @SergiiShymko #mm16it