Upload
trinhkhue
View
232
Download
1
Embed Size (px)
Citation preview
Migrate from Magento 1 to Magento 2 Like a Pro
Project Manager, Expert Consulting Group
Noelle Darlington
Business Solutions Architect, Expert Consulting Group
Gordon Knoppe
It’s Soup to Nuts!
The Phases of Approach
Analyze
Analysis
1. Code Audit
2. Requirements
3. Theme
4. Test Documentation
• Unused modules
• JavaScript functionality
• Business logic in templates
Code Audit• Custom modules
• Third-party extensions
• Dependencies between modules and extensions
Requirements• Huh? It’s obvious.
• Obsolete customizations
• Map out M1 and M2 Features in Use
• Desktop vs mobile
• How will it be tested?
• Deployment tools
The Theme
• Identify theme requirements
• Create theme approach
• Theme is not migrated with tools
Test Documentation
• Start early
• Plan for end-to-end testing
• Written documentation gap analysis
• Map to requirements
Strategize
Strategies
Code
• New features
• 3rd party extensions
• Customizations
• Theming
• Integrations
Data
• Information
Operations
• Business processes
• Infrastructure
• Environments
• Testing
New Features
• New in Magento 2
• Or maybe just new to you?
• Return to native
• Demo, demo, demo for your business users!
Third-party Extensions
• Full inventory of installed extensions
• Remove, return to native, upgrade
• Is it ready?
• Does it do everything it did in the Magento 1 version?
Custom Modules
• Native + 3rd party ext. + ??? = Your site
• Remove or migrate
• Re-architect
– Divide, merge, or completely refactor?
Theming and Personal Devices
• HTML, CSS and JavaScript
• Build on a responsive foundation
• Single theme or global multi-store with unified branding?
• Supported devices and responsive break points
Integrations
• High-level view of integrations with third-party systems
• Landscape diagram
• Integration technology approach
• Remove, migrate, re-architect
Information Migration
• Database, media, legacy design / content elements?
• Open source data migration tool
• How much? How long?
• Clear plan for launch day
• Practice, practice, practice
Infrastructure
• Modern technology stack
• Your hosting and service choices
• Deployment process
• ECG whitepaper coming soon on this topic
Environments
• Development
• Staging / QA
• UAT
• Production
• Existing Magento 1 site?
• Move to the cloud?
• Local developer
virtualization?
Testing Strategy
• Magento 2 ships ready for testing
• Continuous Integration?
• Testing plans for your customizations
Business Process Changes
• Processes subject to change
• Looking for something? Things have moved…
• Admin users by role and their tasks
Time to get to work on the code!
Code Transformation / Migration
• Migration tools
– https://github.com/magento/code-migration
• Iterative development
• Stay tuned for Sergii Shymko’s presentation!
Quality Assurance
Testing
1. Test plan
a) Developersb) QA teamc) UAT plansd) Toolse) Communicationf) Workflow
2. Test environment
3. Test cases
Inputs:Requirements &Client’s UAT Test Cases
Outputs:Test Cases &Requirements-to-Test-Case Matrix
UAT Testing
Test Plan Input: Client’s UAT Test Cases
Output: Client’s testing issues and test result
• Integrations & end-to-end systems testing• Regression testing• User Acceptance Testing (UAT) of all site and admin features• Deployment testing• Recovery
Cutover
Staging and production cutover• Ordered list of steps to be taken during staging and production
cutover– Order of operation– Dependency– Task description– Responsible party– Status (to do, done)
• The cutover should be practiced and tested to catch issues and establish realistic timeframes
Questions & Answers
Copyright © 2016 Magento, Inc.; All Rights Reserved.
Magento® and its respective logos are trademarks, service marks, registered trademarks, or registered service marks ofMagento, Inc. and its affiliates. Other trademarks or service marks contained in this presentation are the property of therespective companies with which they are associated.
This presentation is for informational and discussion purposes only and should not be construed as a commitment of Magento,Inc. or of any of its affiliates. While we attempt to ensure the accuracy, completeness and adequacy of this presentation, neitherMagento, Inc. nor any of its affiliates are responsible for any errors or will be liable for the use of, or reliance upon, thispresentation or any of the information contained in it. Unauthorized use, disclosure or dissemination of this information isexpressly prohibited.
Manager, Product ManagementMagento Inc.
Elena Leonova
Magento 1.x to Magento 2 Code Migration Tool
Architect, Expert Consulting GroupMagento Inc.
Sergii Shymko
Magento 2 Upgrade Scope
Database
Schema
Data
Codebase
Magento framework
3rd party extensions
Custom modules
Custom themes
@SergiiShymko
Magento 2 Upgrade Tooling
Database
Schema
Data
Codebase
Magento framework
3rd party extensions
Custom modules
Custom themes
Data migration toolgithub.com/magento/data-migration-
tool
Code migration toolgithub.com/magento/code-migration
@SergiiShymko
Code Migration Tool Scope
Configuration
<?php // code ;)
Layout
Magentomodule
@SergiiShymko
Directorystructure
Code Migration Tool Overview• Audience: Magento developers• Interface: Command line interface (CLI)• Goal: Automate routine code changes• Methodology: Static code analysis• Remaining work: Manual testing, troubleshooting, fixing
Code migration tool
Magento 1.xsource code
Magento 2source code
@SergiiShymko
Prerequisite Directories
<tool> – Installed code migration tool
<src> – Custom Magento 1.x code to be migrated
<dst> – Empty directory to put generated Magento 2 code to
<m1> – Vanilla Magento 1.x codebase + <src> + dependencies
<m2> – Vanilla Magento 2 codebase
@SergiiShymko
Directory Utilization
Code migration tool<src> <dst>
<m1> <m2>
@SergiiShymko
Directory Utilization
Code migration tool<src> <dst>
<m1> <m2>
@SergiiShymko
Migration Sequence
Generate
mappings
Migrate directory structur
e
Migrate layout
Migrate config
Migrate PHP code
1. 2. 3. 4. 5.
@SergiiShymko
Command to run:
1. Mapping Generation• Mapping between Magento 1.x and Magento 2:
– Latest releases – out of the box– Any versions – generated on demand
• Mapping covers:– Module names– Class names & dependencies– Table names– View files
php <tool>/bin/utils.php generateClassMapping <m1> <m2>
@SergiiShymko
Magento 1.x Magento 2
Mage_Catalog Magento_Catalog
Enterprise_Catalog Magento_AdvancedCatalog
… …
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
php <tool>/bin/migrate.php migrateModuleStructure <src> <dst>
@SergiiShymko
Magento 1.x Magento 2
2. Directory Structure Migration
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>/
@SergiiShymko
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
Magento 1.x Magento 2
3. Layout Migration
app/design/
frontend/base/default/
layout/example.xml
app/code/
Example/Module/view/
frontend/layout/
default.xml…
@SergiiShymko
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
Magento 1.x Magento 2
4. Configuration Migration
app/code/community/
Example/Module/etc/
config.xml
app/code/
Example/Module/etc/[<area>/]
module.xml…
…
@SergiiShymko
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
5. PHP Code Migration
@SergiiShymko
Tool Commands Summary1. 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
a. Commit disabled Magento 2 modulesb. 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 projectb. Run the tool against Magento 1.x codebase
1. Magento 1.x codebase tasks
a. Remove unused modulesb. Revert modifications of core files ]:->c. Remove fixes of bugs irrelevant in Magento 2
@SergiiShymko
Q & AThank You!
Elena [email protected]
github.com/magento/code-migrationgithub.com/magento/data-migration-tooldevdocs.magento.com/guides/v2.0/migration/migration-tool.html
Sergii [email protected]