SlideShare a Scribd company logo
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

More Related Content

What's hot

Max Yekaterynenko: Magento 2 overview
Max Yekaterynenko: Magento 2 overviewMax Yekaterynenko: Magento 2 overview
Max Yekaterynenko: Magento 2 overview
Meet Magento Italy
 
Magento 2: A technical overview
Magento 2: A technical overviewMagento 2: A technical overview
Magento 2: A technical overview
X.commerce
 
Federico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento VersionFederico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento Version
Meet Magento Italy
 
Magento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 SummaryMagento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 Summary
Yireo
 
Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent
MeetMagentoNY2014
 
Magento 2 Development for PHP Developers
Magento 2 Development for PHP DevelopersMagento 2 Development for PHP Developers
Magento 2 Development for PHP Developers
Joshua Warren
 
Magento 2 + composer
Magento 2 + composerMagento 2 + composer
Magento 2 + composer
Peter Jaap Blaakmeer
 
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
Magestore
 
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions DistributionSergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Meet Magento Italy
 
Magento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | MagenestMagento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | Magenest
Magenest
 
Architecture of the Web browser
Architecture of the Web browserArchitecture of the Web browser
Architecture of the Web browser
Sabin Buraga
 
Meet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey IvashchenkoMeet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey Ivashchenko
Amasty
 
Oracle Forms Creation
Oracle Forms CreationOracle Forms Creation
Oracle Forms Creation
Sekhar Byna
 
Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015
David Alger
 
Макс Екатериненко - Meet Magento Ukraine - Magento 2 Overview
Макс Екатериненко - Meet Magento Ukraine - Magento 2 OverviewМакс Екатериненко - Meet Magento Ukraine - Magento 2 Overview
Макс Екатериненко - Meet Magento Ukraine - Magento 2 Overview
Atwix
 
redCORE: an abstracted development layer for Joomla! - JWC14
redCORE: an abstracted development layer for Joomla! - JWC14redCORE: an abstracted development layer for Joomla! - JWC14
redCORE: an abstracted development layer for Joomla! - JWC14
Tito Alvarez
 
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
Yireo
 
Oracle apps online training
Oracle apps online trainingOracle apps online training
Oracle apps online training
Sekhar Byna
 
Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2
Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2
Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2
Meet Magento Italy
 
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...
Meet Magento Italy
 

What's hot (20)

Max Yekaterynenko: Magento 2 overview
Max Yekaterynenko: Magento 2 overviewMax Yekaterynenko: Magento 2 overview
Max Yekaterynenko: Magento 2 overview
 
Magento 2: A technical overview
Magento 2: A technical overviewMagento 2: A technical overview
Magento 2: A technical overview
 
Federico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento VersionFederico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento Version
 
Magento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 SummaryMagento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 Summary
 
Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent
 
Magento 2 Development for PHP Developers
Magento 2 Development for PHP DevelopersMagento 2 Development for PHP Developers
Magento 2 Development for PHP Developers
 
Magento 2 + composer
Magento 2 + composerMagento 2 + composer
Magento 2 + composer
 
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
 
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions DistributionSergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions Distribution
 
Magento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | MagenestMagento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | Magenest
 
Architecture of the Web browser
Architecture of the Web browserArchitecture of the Web browser
Architecture of the Web browser
 
Meet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey IvashchenkoMeet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey Ivashchenko
 
Oracle Forms Creation
Oracle Forms CreationOracle Forms Creation
Oracle Forms Creation
 
Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015
 
Макс Екатериненко - Meet Magento Ukraine - Magento 2 Overview
Макс Екатериненко - Meet Magento Ukraine - Magento 2 OverviewМакс Екатериненко - Meet Magento Ukraine - Magento 2 Overview
Макс Екатериненко - Meet Magento Ukraine - Magento 2 Overview
 
redCORE: an abstracted development layer for Joomla! - JWC14
redCORE: an abstracted development layer for Joomla! - JWC14redCORE: an abstracted development layer for Joomla! - JWC14
redCORE: an abstracted development layer for Joomla! - JWC14
 
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
 
Oracle apps online training
Oracle apps online trainingOracle apps online training
Oracle apps online training
 
Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2
Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2
Manuele Menozzi - Gestione delle dipendenze con Composer in Magento 2
 
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...
 

Similar to Magento 2 Code Migration Tool

Kentico CMS 7 – Mobile web development
Kentico CMS 7 – Mobile web developmentKentico CMS 7 – Mobile web development
Kentico CMS 7 – Mobile web development
Thomas Robbins
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend Development
Kapil Dev Singh
 
Magento2 frontend development
Magento2   frontend developmentMagento2   frontend development
Magento2 frontend development
Kapil Dev Singh
 
Magento
MagentoMagento
Front End Development in Magento
Front End Development in MagentoFront End Development in Magento
Front End Development in Magento
Eric Landmann
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2
Mathew Beane
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBo-Yi Wu
 
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
James Cowie
 
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
Milan Stojanov
 
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
David Webster
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
Mage Guru
 
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 devsITCamp
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
Mohammad Shaker
 
Magento 2 - Getting started.
Magento 2 - Getting started.Magento 2 - Getting started.
Magento 2 - Getting started.
Aneesh Sreedharan
 
Innovations in Sencha Tooling and Framework
Innovations in Sencha Tooling and FrameworkInnovations in Sencha Tooling and Framework
Innovations in Sencha Tooling and Framework
Sandeep Adwankar
 
Uniface 10 IDE Under the Hood
Uniface 10 IDE Under the HoodUniface 10 IDE Under the Hood
Uniface 10 IDE Under the Hood
Uniface
 
Yoav Kutner Dutchento
Yoav Kutner DutchentoYoav Kutner Dutchento
Yoav Kutner Dutchento
Guido X Jansen
 
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
Mathew Beane
 
Maintainable Sitecore Solutions
Maintainable Sitecore SolutionsMaintainable Sitecore Solutions
Maintainable Sitecore SolutionsThomas Eldblom
 
Magento 2 Modules are Easy!
Magento 2 Modules are Easy!Magento 2 Modules are Easy!
Magento 2 Modules are Easy!
Ben Marks
 

Similar to Magento 2 Code Migration Tool (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
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2
 
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
 
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
 
Magento 2 Modules are Easy!
Magento 2 Modules are Easy!Magento 2 Modules are Easy!
Magento 2 Modules are Easy!
 

More from Sergii Shymko

Developing Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoDeveloping Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with Magento
Sergii Shymko
 
Composer in Magento
Composer in MagentoComposer in Magento
Composer in Magento
Sergii Shymko
 
Magento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions DistributionMagento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions Distribution
Sergii Shymko
 
Magento 2 Enhanced Theme/Skin Localization
Magento 2 Enhanced Theme/Skin LocalizationMagento 2 Enhanced Theme/Skin Localization
Magento 2 Enhanced Theme/Skin Localization
Sergii Shymko
 
Magento Performance Toolkit
Magento Performance ToolkitMagento Performance Toolkit
Magento Performance Toolkit
Sergii Shymko
 
Developing Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoDeveloping Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with Magento
Sergii Shymko
 
Magento 2 View Layer Evolution
Magento 2 View Layer EvolutionMagento 2 View Layer Evolution
Magento 2 View Layer Evolution
Sergii Shymko
 
Magento 2 Theme Localization
Magento 2 Theme LocalizationMagento 2 Theme Localization
Magento 2 Theme Localization
Sergii Shymko
 
Running Magento 1.x Extension on Magento 2
Running Magento 1.x Extension on Magento 2Running Magento 1.x Extension on Magento 2
Running Magento 1.x Extension on Magento 2
Sergii Shymko
 
Code Generation in Magento 2
Code Generation in Magento 2Code Generation in Magento 2
Code Generation in Magento 2
Sergii Shymko
 
Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2
Sergii Shymko
 

More from Sergii Shymko (11)

Developing Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoDeveloping Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with Magento
 
Composer in Magento
Composer in MagentoComposer in Magento
Composer in Magento
 
Magento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions DistributionMagento 2 Composer for Extensions Distribution
Magento 2 Composer for Extensions Distribution
 
Magento 2 Enhanced Theme/Skin Localization
Magento 2 Enhanced Theme/Skin LocalizationMagento 2 Enhanced Theme/Skin Localization
Magento 2 Enhanced Theme/Skin Localization
 
Magento Performance Toolkit
Magento Performance ToolkitMagento Performance Toolkit
Magento Performance Toolkit
 
Developing Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with MagentoDeveloping Loosely Coupled Modules with Magento
Developing Loosely Coupled Modules with Magento
 
Magento 2 View Layer Evolution
Magento 2 View Layer EvolutionMagento 2 View Layer Evolution
Magento 2 View Layer Evolution
 
Magento 2 Theme Localization
Magento 2 Theme LocalizationMagento 2 Theme Localization
Magento 2 Theme Localization
 
Running Magento 1.x Extension on Magento 2
Running Magento 1.x Extension on Magento 2Running Magento 1.x Extension on Magento 2
Running Magento 1.x Extension on Magento 2
 
Code Generation in Magento 2
Code Generation in Magento 2Code Generation in Magento 2
Code Generation in Magento 2
 
Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2
 

Recently uploaded

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
manasideore6
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
Kamal Acharya
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 

Recently uploaded (20)

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 

Magento 2 Code Migration Tool

  • 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

Editor's Notes

  1. Magento 1.x – module in 5 directories Magento 2 – module in 1 directory <module_dir>/ = <Vendor>/<Module>/
  2. Convention over configuration
  3. Merging preserved XSD validation