expert guidance on migrating from magento 1 to magento 2

60

Upload: james-cowie

Post on 11-Apr-2017

29 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Expert guidance on migrating from magento 1 to magento 2
Page 2: Expert guidance on migrating from magento 1 to magento 2

Expert Guidance on Migrating from Magento 1 to Magento 2

Page 3: Expert guidance on migrating from magento 1 to magento 2

Gordon KnoppeBusiness Solutions Architect, ECG

James CowieTechnical Architect, ECG

Page 4: Expert guidance on migrating from magento 1 to magento 2

Expert Consulting Group

ECG Charter: To provide expert insight, review, and guidance at every stage of the Magento project lifecycle.

• Customer Success: Leverage innovative technologies and superior talent to exceed customer expectations in every way.

• Quality and Scale: Drive quality for all implementations, large and small, to ensure success on the Magento platform.

• Thought Leadership: Develop and publish best practices to increase quality in the Magento community.

Page 5: Expert guidance on migrating from magento 1 to magento 2

Expert Consulting Group

Preferred Service

Technical Account Manager

Page 6: Expert guidance on migrating from magento 1 to magento 2

Migration Analysis Methodology

Current Magento Landscape

Codebase & Database

System landscape & Systems of record

Requirements & Wireframes

Test Documentation

Existing and Future-state Infrastructure Diagrams

Environments

Dev Tools & SDLC

StrategiesReview and Assess

• Custom Modules• Extensions• New Features• Theme• Personal Devices• Integrations• Information Migration• Business Process Changes• Infrastructure• Environments• Testing

• Desktop and personal device requirements

• Integrity of Magento Core code• Custom Modules• Extensions• Customized Features• Integrations• Database• Theme and Templates• Test Documentation• Infrastructure• Environments

Page 7: Expert guidance on migrating from magento 1 to magento 2

Migration Analysis

Confidence is the feeling you have before you fully understand the situation.

- Unknown

Page 8: Expert guidance on migrating from magento 1 to magento 2

Analysis Phase - Features

1. Requirements

2. Code Audit

3. Theme

4. Testing Process

Page 9: Expert guidance on migrating from magento 1 to magento 2

Code Audit

• Custom development

• Third-party extensions

• Dependencies between extensions

• Un-used modules

• JavaScript functionality

• Business logic in templates

Page 10: Expert guidance on migrating from magento 1 to magento 2

Requirements

• Obsolete customizations

• Magento native features and functionality in use

• Desktop vs. mobile, progressive enhancement

• Mapping requirements to tests and acceptance

Page 11: Expert guidance on migrating from magento 1 to magento 2

Theme

• Identify theme requirements

• Create theme approach

• Theme is not migrated by tools

Page 12: Expert guidance on migrating from magento 1 to magento 2

Testing Process

• Start early, understand what you’ve got

• End-to-end (integration) testing

• Written documentation and gap analysis

• Mapping tests to requirements?

Page 13: Expert guidance on migrating from magento 1 to magento 2

Analysis - Supporting Elements

1. Landscape Diagram / Integrations

2. Data (size, scope, locations)

3. Environments

Page 14: Expert guidance on migrating from magento 1 to magento 2

Strategy and Vision

If you aim at nothing, you will hit it every time.

- Zig Ziglar

Page 15: Expert guidance on migrating from magento 1 to magento 2

New Features

• New in Magento 2

– Or maybe just new to you?

• Return to native

• Demo, demo, demo for your business users!

Page 16: Expert guidance on migrating from magento 1 to magento 2

Third-party Extensions

• Full inventory of installed extensions and versions

• Remove, return to native, upgrade

• Does it do everything it did in the Magento 1 version?

Page 17: Expert guidance on migrating from magento 1 to magento 2

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: Expert guidance on migrating from magento 1 to magento 2

Custom Modules

• Code custom built to satisfy your requirements

• Remove or migrate

• Re-architect (refer to James)

– Divide

– Merge

– Refactor

Page 19: Expert guidance on migrating from magento 1 to magento 2

Non-code Related Strategies

• Integrations

• Information Migration

• Infrastructure and Environments

• Testing Strategy

• Business Process Changes

Page 20: Expert guidance on migrating from magento 1 to magento 2

Data Migration in ActionData is a precious thing and will last longer than the systems themselves.

Tim Berners-Lee

Page 21: Expert guidance on migrating from magento 1 to magento 2

Magento official Data migration tool

https://github.com/magento/data-migration-tool

Page 22: Expert guidance on migrating from magento 1 to magento 2

Best Practices

• Remove outdated and redundant data

• Close by MySQL instances

• Use a replicated Magento 1 database NOT live

Page 23: Expert guidance on migrating from magento 1 to magento 2

Benchmarks

• Database had:– 177k products,

– 355k orders,

– 214k customers

Page 24: Expert guidance on migrating from magento 1 to magento 2

Performance results

• Settings migration time: ~10 mins

• Data migration time: ~9 hours for full migration

Page 25: Expert guidance on migrating from magento 1 to magento 2

Performance results

• Site downtime – Around 5 minutes for re-index.

– DNS propagation

Page 26: Expert guidance on migrating from magento 1 to magento 2

What does it do?

• Store Configuration

• Products

• Customers

• Orders

• Promotions

Page 27: Expert guidance on migrating from magento 1 to magento 2

Modes

• Store Configuration settings

• Data

• Delta (changes since the last run)

Page 28: Expert guidance on migrating from magento 1 to magento 2

Prerequisites

• Have Magento 2 Installed

• Don’t start the Magento 2 cron jobs

• Database Backups

Page 29: Expert guidance on migrating from magento 1 to magento 2

Install

composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool

composer require-dev magento/data-migration-tool:<version>

Page 30: Expert guidance on migrating from magento 1 to magento 2

Configure your version

• CE to CE

• CE to EE

• EE to EE

Pick your migration path:

Page 31: Expert guidance on migrating from magento 1 to magento 2

Configure your version

• 1.6.0.0

• …

• 1.9.3.2

Pick the version number of Magento 1 used:

Page 32: Expert guidance on migrating from magento 1 to magento 2

Configuring the tool – config.xml

Copy the file specific to your version.

<source> <database host="127.0.0.1" name="magento1" user="root"/> </source>

<destination> <database host="127.0.0.1" name="magento2" user="root"/> </destination>

Page 33: Expert guidance on migrating from magento 1 to magento 2

Configuring the tool – config.xml

Copy the file specific to your version.

<source> <database host="127.0.0.1" name="magento1" user="root"/> </source>

<destination> <database host="127.0.0.1" name="magento2" user="root"/> </destination>

Best Practice: Keep these as close as possible.

Page 34: Expert guidance on migrating from magento 1 to magento 2

Mappings, How it all works

• Mapping Files– Changing table names

– Changing field names

– Ignoring tables or fields

– Adapt transferring of data

Page 35: Expert guidance on migrating from magento 1 to magento 2

Running the tool

> php bin/magento

migrate migrate:data migrate:delta migrate:settings

Page 36: Expert guidance on migrating from magento 1 to magento 2

Remember the order

• Settings

• Data

• Deltas

Page 37: Expert guidance on migrating from magento 1 to magento 2

Common errors

• Invalid attributes– Differing data types

• Source field not mapped

Page 38: Expert guidance on migrating from magento 1 to magento 2

Map Files

• Maps data between systems

• Ignore fields

• Field Rules– Move fields from one name to another– Transform fields from one type to another

• Rules can apply to:– Source (m1) – Destination (m2)

Page 39: Expert guidance on migrating from magento 1 to magento 2

Example

[ERROR]: Source fields not mapped.

Document: sales_flat_order_address. Fields: giftregistry_item_id

Page 40: Expert guidance on migrating from magento 1 to magento 2

Source field not found

• config.xml

<map_file>etc/ce-to-ce/1.9.2.3/map.xml.dist</map_file>

<map_file>etc/ce-to-ce/1.9.2.3/map.xml</map_file>

Page 41: Expert guidance on migrating from magento 1 to magento 2

map.xml

<ignore> <field>sales_flat_order_address.giftregistry_item_id</field></ignore>

Page 42: Expert guidance on migrating from magento 1 to magento 2

map.xml

<ignore> <field>sales_flat_order_address.giftregistry_item_id</field></ignore>

Document Field

Page 43: Expert guidance on migrating from magento 1 to magento 2

Tables that don’t exist on Magento 2

<source> <document_rules> <ignore> <document>Table Name</document> </ignore>

Page 44: Expert guidance on migrating from magento 1 to magento 2

Deltas

• Only to be ran after initial migration

• Changes since last run

• Run as often as possible (Multiple times per day)

• Start this process early in migration plan

Page 45: Expert guidance on migrating from magento 1 to magento 2

Custom data structures for modules

• Ensure schema exists in both DB’s

• Only add mappings if you want to change things.

• Will migrate data automatically

Page 46: Expert guidance on migrating from magento 1 to magento 2

Cleaning up

• Check databases for temporary tables

• Stop delta process running

• Remove tool tables listed in deltalog.xml

• Remove code from composer

Page 47: Expert guidance on migrating from magento 1 to magento 2

Conclusion for Data

• Practice, Practice and Practice

• Use mappings for everything

• Could use “scripts” but data migration can work well

• Use Ignore responsibly

• Integration with Business plans and process.

Page 48: Expert guidance on migrating from magento 1 to magento 2

Preparing for codeHow to bring modules into M2

Page 49: Expert guidance on migrating from magento 1 to magento 2

Automated tools

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

Page 50: Expert guidance on migrating from magento 1 to magento 2

Overview of Official Tool

• Static file generation

• Maps types:– Models / Resource Models / Collections

– Controllers

– Actions

– Blocks

– XML

• Repeatable process

Page 51: Expert guidance on migrating from magento 1 to magento 2

What’s changed in module code

• Plugins

• Interceptors

• Dependency Injection

• Composer

• UI components

• API & Service contracts ( Interfaces )

Page 52: Expert guidance on migrating from magento 1 to magento 2

Plugins

• Modify Behavior of public methods and class• Before, Around and After

• Reduces observer dependency mess.

Page 53: Expert guidance on migrating from magento 1 to magento 2

Dependency Injection

• Use DI over new instantiation

• Constructor Arguments

• Removes “God” class and thinking

Page 54: Expert guidance on migrating from magento 1 to magento 2

Composer

• Easily manage module dependencies

• Pin versions of packages based on semantic versioning

• Think create for reuse

• Small helpful packages

• Stop inventing the wheel

Page 55: Expert guidance on migrating from magento 1 to magento 2

UI Components

• Empower forms for adminhtml

• Used through checkout and frontend as new bindings of logic

Page 56: Expert guidance on migrating from magento 1 to magento 2

Concluding Code

• Use automation for “prototype”

• Consider time needed for rewrite – Learning time

– Implementing time

• Be selective with functionality migrated

Page 57: Expert guidance on migrating from magento 1 to magento 2

Beyond Code and DataMigrating process. How to deploy

Page 58: Expert guidance on migrating from magento 1 to magento 2

Deployments

• Static assets

• Composer dependencies

• Code generation

• Database coupling*

Page 59: Expert guidance on migrating from magento 1 to magento 2

Options for deployment

• Continuous integration

• Build servers

Page 60: Expert guidance on migrating from magento 1 to magento 2

Any Questions ? Thank-you for your time.