Since the official release of Magento 2 in November 2015, upgrading from Magento 1.x has become a goal for store owners and extension vendors. Being a major release, Magento 2 has made leaps forward in the application architecture, which contributes to the upgrade complexity. One of the major challenges is upgrade of a codebase. Code migration tool has been created to tackle this task. Current presentation goes over the capabilities of the tool. We discuss how to employ the tool for a successful upgrade project.
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>
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>
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