54

Migrate from Magento 1

Embed Size (px)

Citation preview

Page 1: Migrate from Magento 1
Page 2: Migrate from Magento 1

Migrate from Magento 1 to Magento 2 Like a Pro

Page 3: Migrate from Magento 1

Project Manager, Expert Consulting Group

Noelle Darlington

Business Solutions Architect, Expert Consulting Group

Gordon Knoppe

Page 4: Migrate from Magento 1

It’s Soup to Nuts!

Page 5: Migrate from Magento 1

The Phases of Approach

Page 6: Migrate from Magento 1

Analyze

Page 7: Migrate from Magento 1

Analysis

1. Code Audit

2. Requirements

3. Theme

4. Test Documentation

Page 8: Migrate from Magento 1

• Unused modules

• JavaScript functionality

• Business logic in templates

Code Audit• Custom modules

• Third-party extensions

• Dependencies between modules and extensions

Page 9: Migrate from Magento 1

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

Page 10: Migrate from Magento 1

The Theme

• Identify theme requirements

• Create theme approach

• Theme is not migrated with tools

Page 11: Migrate from Magento 1

Test Documentation

• Start early

• Plan for end-to-end testing

• Written documentation gap analysis

• Map to requirements

Page 12: Migrate from Magento 1

Strategize

Page 13: Migrate from Magento 1

Strategies

Code

• New features

• 3rd party extensions

• Customizations

• Theming

• Integrations

Data

• Information

Operations

• Business processes

• Infrastructure

• Environments

• Testing

Page 14: Migrate from Magento 1

New Features

• New in Magento 2

• Or maybe just new to you?

• Return to native

• Demo, demo, demo for your business users!

Page 15: Migrate from Magento 1

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?

Page 16: Migrate from Magento 1

Custom Modules

• Native + 3rd party ext. + ??? = Your site

• Remove or migrate

• Re-architect

– Divide, merge, or completely refactor?

Page 17: Migrate from Magento 1

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

Page 18: Migrate from Magento 1

Integrations

• High-level view of integrations with third-party systems

• Landscape diagram

• Integration technology approach

• Remove, migrate, re-architect

Page 19: Migrate from Magento 1

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

Page 20: Migrate from Magento 1

Infrastructure

• Modern technology stack

• Your hosting and service choices

• Deployment process

• ECG whitepaper coming soon on this topic

Page 21: Migrate from Magento 1

Environments

• Development

• Staging / QA

• UAT

• Production

• Existing Magento 1 site?

• Move to the cloud?

• Local developer

virtualization?

Page 22: Migrate from Magento 1

Testing Strategy

• Magento 2 ships ready for testing

• Continuous Integration?

• Testing plans for your customizations

Page 23: Migrate from Magento 1

Business Process Changes

• Processes subject to change

• Looking for something? Things have moved…

• Admin users by role and their tasks

Page 24: Migrate from Magento 1

Time to get to work on the code!

Page 25: Migrate from Magento 1

Code Transformation / Migration

• Migration tools

– https://github.com/magento/code-migration

• Iterative development

• Stay tuned for Sergii Shymko’s presentation!

Page 26: Migrate from Magento 1

Quality Assurance

Page 27: Migrate from Magento 1

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

Page 28: Migrate from Magento 1

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

Page 29: Migrate from Magento 1

Cutover

Page 30: Migrate from Magento 1

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

Page 31: Migrate from Magento 1

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.

Page 32: Migrate from Magento 1
Page 33: Migrate from Magento 1

Manager, Product ManagementMagento Inc.

Elena Leonova

Magento 1.x to Magento 2 Code Migration Tool

Architect, Expert Consulting GroupMagento Inc.

Sergii Shymko

Page 34: Migrate from Magento 1

Magento 2 Upgrade Scope

Database

Schema

Data

Codebase

Magento framework

3rd party extensions

Custom modules

Custom themes

@SergiiShymko

Page 35: Migrate from Magento 1

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

Page 36: Migrate from Magento 1

Code Migration Tool Scope

Configuration

<?php // code ;)

Layout

Magentomodule

@SergiiShymko

Directorystructure

Page 37: Migrate from Magento 1

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

Page 38: Migrate from Magento 1

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

Page 39: Migrate from Magento 1

Directory Utilization

Code migration tool<src> <dst>

<m1> <m2>

@SergiiShymko

Page 40: Migrate from Magento 1

Directory Utilization

Code migration tool<src> <dst>

<m1> <m2>

@SergiiShymko

Page 41: Migrate from Magento 1
Page 42: Migrate from Magento 1

Migration Sequence

Generate

mappings

Migrate directory structur

e

Migrate layout

Migrate config

Migrate PHP code

1. 2. 3. 4. 5.

@SergiiShymko

Page 43: Migrate from Magento 1

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

… …

Page 44: Migrate from Magento 1

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

Page 45: Migrate from Magento 1

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

Page 46: Migrate from Magento 1

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

Page 47: Migrate from Magento 1

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

Page 48: Migrate from Magento 1

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

Page 49: Migrate from Magento 1

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

Page 50: Migrate from Magento 1

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

Page 51: Migrate from Magento 1

5. PHP Code Migration

@SergiiShymko

Page 52: Migrate from Magento 1

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

Page 53: Migrate from Magento 1

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

Page 54: Migrate from Magento 1

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]