Water Industry Process Automation & Control Monthly - April 2024
Magento 1.x to Magento 2 Code Migration Tools
1.
2. Manager, Product Management
Magento Inc.
Elena Leonova
Magento 1.x to Magento 2
Code Migration Tool
Architect, Expert Consulting Group
Magento Inc.
Sergii Shymko
3. Magento 2 Upgrade Scope
Database
Schema
Data
Codebase
Magento framework
3rd party extensions
Custom modules
Custom themes
@SergiiShymko
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
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
php <tool>/bin/migrate.php convertLayout <dst>
@SergiiShymko
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
php <tool>/bin/migrate.php convertConfig <dst>
@SergiiShymko
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”
php <tool>/bin/migrate.php convertPhpCode <dst> <m1> <m2>
@SergiiShymko
21. a. Commit disabled Magento 2 modules
b. Test, fix, and enable module by module
3. Magento 2 codebase tasks
Code Upgrade Project Breakdown
2. Code migration tool tasks
a. Tailor the tool for patterns unique to the project
b. Run the tool against Magento 1.x codebase
1. Magento 1.x codebase tasks
a. Remove unused modules
b. Revert modifications of core files ]:->
c. Remove fixes of bugs irrelevant in Magento 2
@SergiiShymko
22. Q & A
Thank You!
Elena Leonova
eleonova@magento.com
github.com/magento/code-migration
github.com/magento/data-migration-tool
devdocs.magento.com/guides/v2.0/migration/migration-tool.html
Sergii Shymko
sshymko@magento.com
Hinweis der Redaktion
Magento 1.x – module in 5 directories
Magento 2 – module in 1 directory
<module_dir>/ = <Vendor>/<Module>/