expert guidance on migrating from magento 1 to magento 2
TRANSCRIPT
![Page 1: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/1.jpg)
![Page 2: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/2.jpg)
Expert Guidance on Migrating from Magento 1 to Magento 2
![Page 3: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/3.jpg)
Gordon KnoppeBusiness Solutions Architect, ECG
James CowieTechnical Architect, ECG
![Page 4: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/4.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/5.jpg)
Expert Consulting Group
Preferred Service
Technical Account Manager
![Page 6: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/6.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/7.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/9.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/10.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/11.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/12.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/13.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/14.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/15.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/16.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/17.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/18.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/19.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/20.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/21.jpg)
Magento official Data migration tool
https://github.com/magento/data-migration-tool
![Page 22: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/22.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/23.jpg)
Benchmarks
• Database had:– 177k products,
– 355k orders,
– 214k customers
![Page 24: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/24.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/25.jpg)
Performance results
• Site downtime – Around 5 minutes for re-index.
– DNS propagation
![Page 26: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/26.jpg)
What does it do?
• Store Configuration
• Products
• Customers
• Orders
• Promotions
![Page 27: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/27.jpg)
Modes
• Store Configuration settings
• Data
• Delta (changes since the last run)
![Page 28: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/28.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/29.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/30.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/31.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/32.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/33.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/34.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/35.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/36.jpg)
Remember the order
• Settings
• Data
• Deltas
![Page 37: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/37.jpg)
Common errors
• Invalid attributes– Differing data types
• Source field not mapped
![Page 38: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/38.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/39.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/40.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/41.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/42.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/43.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/44.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/45.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/46.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/47.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/48.jpg)
Preparing for codeHow to bring modules into M2
![Page 49: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/49.jpg)
Automated tools
https://github.com/magento/code-migration
![Page 50: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/50.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/51.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/52.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/53.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/54.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/55.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/56.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/57.jpg)
Beyond Code and DataMigrating process. How to deploy
![Page 58: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/58.jpg)
Deployments
• Static assets
• Composer dependencies
• Code generation
• Database coupling*
![Page 59: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/59.jpg)
Options for deployment
• Continuous integration
• Build servers
![Page 60: Expert guidance on migrating from magento 1 to magento 2](https://reader035.vdocuments.us/reader035/viewer/2022062903/58ed00b81a28ab5d7e8b45d3/html5/thumbnails/60.jpg)
Any Questions ? Thank-you for your time.