Page | 2© 2017 Magento, Inc.
Magento 2 Migration
Best Practices
Page | 3© 2017 Magento, Inc.
Brent
Peterson
Magento Evangelist for Wagento Creative
Page | 4© 2017 Magento, Inc.
• Main Components For The Migration
– Data
– Themes
– Extensions
– Customization
• Best Practices Analysis
– Extension Analysis
– Customization Analysis
– Core Code Hack Analysis
– Infrastructure Analysis
• Migration Steps
• Bonus (Time allowed)
• Q/A
Agenda
Highlights to consider in your migration.
Migration Overview
Page | 6© 2017 Magento, Inc.
• The data architecture has changed from Magento 1 to Magento 2
• Data migration focuses on the following:
– Customers
– Orders
– Products
– Promotions
– Store Configuration
– Custom Tables
• Magento Migration Tool: Allows for easy migration of tables from M1 to M2
• http://devdocs.magento.com/guides/v2.1/howdoi/migrate/migrate-data.html
Data Migration
Page | 7© 2017 Magento, Inc.
Theming has changed.
Themes
Extensive layout level changes for better usability and performance.
You current theme can not be directly moved to new install.
Theme re-build is required for Magento 2.
We build themes off the Magento responsive theme.
You are now required to build and deploy themes.
Page | 8© 2017 Magento, Inc.
Time for a theme update!
Themes
Extensive layout level changes for better usability and performance.
You current theme can not be directly moved to new install.
Theme re-build is required for Magento 2.
We build themes off the Magento responsive theme.
You are now required to build and deploy themes.
Page | 9© 2017 Magento, Inc.
Take this opportunity to update UX and even add AMP
Themes
Extensive layout level changes for better usability and performance.
You current theme can not be directly moved to new install.
Theme re-build is required for Magento 2.
We build themes off the Magento responsive theme.
You are now required to build and deploy themes.
Page | 10© 2017 Magento, Inc.
Magento offers a good framework to build from.
Themes
Extensive layout level changes for better usability and performance.
You current theme can not be directly moved to new install.
Theme re-build is required for Magento 2.
We build themes off the Magento responsive theme.
You are now required to build and deploy themes.
Page | 11© 2017 Magento, Inc.
It’s easy and hard… at the same time!
Themes
Extensive layout level changes for better usability and performance.
You current theme can not be directly moved to new install.
Theme re-build is required for Magento 2.
We build themes off the Magento responsive theme.
You are now required to build and deploy themes.
Page | 12© 2017 Magento, Inc.
The main components for migrating extensions.
Extensions
You can’t directly use your old extensions in Magento 2.
Most extension builders are writing their extensions for Magento 2.
There are many new technology partners writing similar extensions.
If you can’t find your old extension you can always rebuild it.
Page | 13© 2017 Magento, Inc.
The Magento community is the best in the world.
Extensions
You can’t directly use your old extensions in Magento 2.
Most extension builders are writing their extensions for Magento 2.
There are many new technology partners writing similar extensions.
If you can’t find your old extension you can always rebuild it.
Page | 14© 2017 Magento, Inc.
If you extension doesn’t exist in Magento 2, look for a new one!
Extensions
You can’t directly use your old extensions in Magento 2.
Most extension builders are writing their extensions for Magento 2.
There are many new technology partners writing similar extensions.
If you can’t find your old extension you can always rebuild it.
Page | 15© 2017 Magento, Inc.
Look for a certified developer.
Extensions
You can’t directly use your old extensions in Magento 2.
Most extension builders are writing their extensions for Magento 2.
There are many new technology partners writing similar extensions.
If you can’t find your old extension you can always rebuild it.
Page | 16© 2017 Magento, Inc.
The bits that aren’t already an existing extension.
Customizations
Your Magento 1.x code is not compatible in Magento 2.
You will have to migrate or re-write your custom code.
Magento Code Migration Tool.
Because the tool is automated there will be refactoring that is required.
Page | 17© 2017 Magento, Inc.
Take this time to make your code even better.
Customizations
Your Magento 1.x code is not compatible in Magento 2.
You will have to migrate or re-write your custom code.
Magento Code Migration Tool.
Because the tool is automated there will be refactoring that is required.
Page | 18© 2017 Magento, Inc.
https://github.com/magento/code-migration
Customizations
Your Magento 1.x code is not compatible in Magento 2.
You will have to migrate or re-write your custom code.
Magento Code Migration Tool.
Because the tool is automated there will be refactoring that is required.
Page | 19© 2017 Magento, Inc.
A small amount of work is required after migration
Customizations
Your Magento 1.x code is not compatible in Magento 2.
You will have to migrate or re-write your custom code.
Magento Code Migration Tool.
Because the tool is automated there will be refactoring that is required.
What the heck are we doing?
ANALYSIS
Page | 21© 2017 Magento, Inc.
{ Prioritize to determine what you need }
Extensions
List all installed extensions.
• Must needed extensions.
• Good to have.
• Can be installed in the future.
• Not needed.
Divide extensions into four groups.
• Unnecessary
• Expired
• Non-Priority
Cleanup
List Extensions Available In Magento 2.
List Extensions To Be Custom Built
Page | 22© 2017 Magento, Inc.
{ diff –wrql <source> <destination> }
Core code Hack
Compare Magento source code with your project source code.
Check & identify all modified code.
Check if hack requirement is already available in Magento 2.
Identify which hack requirement needs redevelopment.
Page | 23© 2017 Magento, Inc.
http://devdocs.magento.com/magento-system-requirements.html
Infrastructure
Magento 2 has new infrastructure requirements.
• Dropped support for PHP 5.5.X.
• Added support for PHP 7.0.X.
• Added support for Elasticsearch 1.7 And 2.X.
• Native support for SOLR and Varnish
Update your infrastructure to suite Magento 2.
• http://devdocs.magento.com/guides/v2.1/install-gde/docker/docker-over.html
Dev Box is a useful tool
The Migration
Page | 25© 2017 Magento, Inc.
M1 To M2 Migration Steps
Take Live
DB Clone
Empty All
Log Tables
Install Data
Migration Tool
Database
Migration
Setting
Migration
Data
Migration
Delta
Migration
Choose Magento
Edition & Version
Troubleshoot
Errors
Data Migration Troubleshooting Guide: http://devdocs.magento.com/guides/v2.1/migration/migration-troubleshooting.html
Codebase
Migration
Put M1 In
Maintenance Mode
Put Store In
Production Mode
Start M2 Cron
Jobs
Flush Cache Reindex Data
Final server
changes
3rd Party
Extensions
Implement
Custom
Features
Install
Themes
Keep
Doing
This Till
Launch
Migrate Data
Manually
(Media, ACL,
Admin)
Page | 26© 2017 Magento, Inc.
Install Magento’s Data Migration Tool
• Data: Stores, Websites, And System Configuration
• Code: bin/magento migrate:settings [-r|--reset] {<path to config.xml>}
Step 1: Setting Migration
• Data: Catalogs, Customers, And Orders,
• Code: bin/magento migrate:data [-r|--reset] {<path to config.xml>}
Step 2: Data Migration
• Data: Same As Data Migration
• Code: bin/magento migrate:delta [-r|--reset] {<path to config.xml>}
Step 3: Delta Migration
How deployments have changed in Magento 2
Bonus time
Page | 28© 2017 Magento, Inc.
Create
Artifact
Push – Build – Tar – Deploy - Run
Deployment
Push to
Git
Build
Server
(or staging)
Send to
webheads
Data Migration Troubleshooting Guide:
http://devdocs.magento.com/guides/v2.1/migration/migration-troubleshooting.html
Web
Head 1
Web
Head 2
Web
Head 3
Page | 29© 2017 Magento, Inc.
Questions?
Anyone...
email: brent@wagento.com
twitter: @brentwpeterson
Page | 30© 2017 Magento, Inc.
• Backup database.
• mysqldump –u<user> -p <database> > myfile.sql
• Restore data and empty all log tables.
• mysql –u<user> -p <new_database> < myfile.sql
• truncate dataflow_batch_export;truncate dataflow_batch_import;truncate log_customer;truncate
log_quote;truncate log_summary;truncate log_summary_type;truncate log_url;truncate log_url_info;truncate
log_visitor;truncate log_visitor_info;truncate log_visitor_online;truncate report_viewed_product_index;truncate
report_compared_product_index;truncate report_event;truncate sendfriend_log;
MySQL backup and restore
Page | 31© 2017 Magento, Inc.
Thank you
email: brent@wagento.com
twitter: @brentwpeterson

Magento 2 Best Practice MLUK17

  • 2.
    Page | 2©2017 Magento, Inc. Magento 2 Migration Best Practices
  • 3.
    Page | 3©2017 Magento, Inc. Brent Peterson Magento Evangelist for Wagento Creative
  • 4.
    Page | 4©2017 Magento, Inc. • Main Components For The Migration – Data – Themes – Extensions – Customization • Best Practices Analysis – Extension Analysis – Customization Analysis – Core Code Hack Analysis – Infrastructure Analysis • Migration Steps • Bonus (Time allowed) • Q/A Agenda
  • 5.
    Highlights to considerin your migration. Migration Overview
  • 6.
    Page | 6©2017 Magento, Inc. • The data architecture has changed from Magento 1 to Magento 2 • Data migration focuses on the following: – Customers – Orders – Products – Promotions – Store Configuration – Custom Tables • Magento Migration Tool: Allows for easy migration of tables from M1 to M2 • http://devdocs.magento.com/guides/v2.1/howdoi/migrate/migrate-data.html Data Migration
  • 7.
    Page | 7©2017 Magento, Inc. Theming has changed. Themes Extensive layout level changes for better usability and performance. You current theme can not be directly moved to new install. Theme re-build is required for Magento 2. We build themes off the Magento responsive theme. You are now required to build and deploy themes.
  • 8.
    Page | 8©2017 Magento, Inc. Time for a theme update! Themes Extensive layout level changes for better usability and performance. You current theme can not be directly moved to new install. Theme re-build is required for Magento 2. We build themes off the Magento responsive theme. You are now required to build and deploy themes.
  • 9.
    Page | 9©2017 Magento, Inc. Take this opportunity to update UX and even add AMP Themes Extensive layout level changes for better usability and performance. You current theme can not be directly moved to new install. Theme re-build is required for Magento 2. We build themes off the Magento responsive theme. You are now required to build and deploy themes.
  • 10.
    Page | 10©2017 Magento, Inc. Magento offers a good framework to build from. Themes Extensive layout level changes for better usability and performance. You current theme can not be directly moved to new install. Theme re-build is required for Magento 2. We build themes off the Magento responsive theme. You are now required to build and deploy themes.
  • 11.
    Page | 11©2017 Magento, Inc. It’s easy and hard… at the same time! Themes Extensive layout level changes for better usability and performance. You current theme can not be directly moved to new install. Theme re-build is required for Magento 2. We build themes off the Magento responsive theme. You are now required to build and deploy themes.
  • 12.
    Page | 12©2017 Magento, Inc. The main components for migrating extensions. Extensions You can’t directly use your old extensions in Magento 2. Most extension builders are writing their extensions for Magento 2. There are many new technology partners writing similar extensions. If you can’t find your old extension you can always rebuild it.
  • 13.
    Page | 13©2017 Magento, Inc. The Magento community is the best in the world. Extensions You can’t directly use your old extensions in Magento 2. Most extension builders are writing their extensions for Magento 2. There are many new technology partners writing similar extensions. If you can’t find your old extension you can always rebuild it.
  • 14.
    Page | 14©2017 Magento, Inc. If you extension doesn’t exist in Magento 2, look for a new one! Extensions You can’t directly use your old extensions in Magento 2. Most extension builders are writing their extensions for Magento 2. There are many new technology partners writing similar extensions. If you can’t find your old extension you can always rebuild it.
  • 15.
    Page | 15©2017 Magento, Inc. Look for a certified developer. Extensions You can’t directly use your old extensions in Magento 2. Most extension builders are writing their extensions for Magento 2. There are many new technology partners writing similar extensions. If you can’t find your old extension you can always rebuild it.
  • 16.
    Page | 16©2017 Magento, Inc. The bits that aren’t already an existing extension. Customizations Your Magento 1.x code is not compatible in Magento 2. You will have to migrate or re-write your custom code. Magento Code Migration Tool. Because the tool is automated there will be refactoring that is required.
  • 17.
    Page | 17©2017 Magento, Inc. Take this time to make your code even better. Customizations Your Magento 1.x code is not compatible in Magento 2. You will have to migrate or re-write your custom code. Magento Code Migration Tool. Because the tool is automated there will be refactoring that is required.
  • 18.
    Page | 18©2017 Magento, Inc. https://github.com/magento/code-migration Customizations Your Magento 1.x code is not compatible in Magento 2. You will have to migrate or re-write your custom code. Magento Code Migration Tool. Because the tool is automated there will be refactoring that is required.
  • 19.
    Page | 19©2017 Magento, Inc. A small amount of work is required after migration Customizations Your Magento 1.x code is not compatible in Magento 2. You will have to migrate or re-write your custom code. Magento Code Migration Tool. Because the tool is automated there will be refactoring that is required.
  • 20.
    What the heckare we doing? ANALYSIS
  • 21.
    Page | 21©2017 Magento, Inc. { Prioritize to determine what you need } Extensions List all installed extensions. • Must needed extensions. • Good to have. • Can be installed in the future. • Not needed. Divide extensions into four groups. • Unnecessary • Expired • Non-Priority Cleanup List Extensions Available In Magento 2. List Extensions To Be Custom Built
  • 22.
    Page | 22©2017 Magento, Inc. { diff –wrql <source> <destination> } Core code Hack Compare Magento source code with your project source code. Check & identify all modified code. Check if hack requirement is already available in Magento 2. Identify which hack requirement needs redevelopment.
  • 23.
    Page | 23©2017 Magento, Inc. http://devdocs.magento.com/magento-system-requirements.html Infrastructure Magento 2 has new infrastructure requirements. • Dropped support for PHP 5.5.X. • Added support for PHP 7.0.X. • Added support for Elasticsearch 1.7 And 2.X. • Native support for SOLR and Varnish Update your infrastructure to suite Magento 2. • http://devdocs.magento.com/guides/v2.1/install-gde/docker/docker-over.html Dev Box is a useful tool
  • 24.
  • 25.
    Page | 25©2017 Magento, Inc. M1 To M2 Migration Steps Take Live DB Clone Empty All Log Tables Install Data Migration Tool Database Migration Setting Migration Data Migration Delta Migration Choose Magento Edition & Version Troubleshoot Errors Data Migration Troubleshooting Guide: http://devdocs.magento.com/guides/v2.1/migration/migration-troubleshooting.html Codebase Migration Put M1 In Maintenance Mode Put Store In Production Mode Start M2 Cron Jobs Flush Cache Reindex Data Final server changes 3rd Party Extensions Implement Custom Features Install Themes Keep Doing This Till Launch Migrate Data Manually (Media, ACL, Admin)
  • 26.
    Page | 26©2017 Magento, Inc. Install Magento’s Data Migration Tool • Data: Stores, Websites, And System Configuration • Code: bin/magento migrate:settings [-r|--reset] {<path to config.xml>} Step 1: Setting Migration • Data: Catalogs, Customers, And Orders, • Code: bin/magento migrate:data [-r|--reset] {<path to config.xml>} Step 2: Data Migration • Data: Same As Data Migration • Code: bin/magento migrate:delta [-r|--reset] {<path to config.xml>} Step 3: Delta Migration
  • 27.
    How deployments havechanged in Magento 2 Bonus time
  • 28.
    Page | 28©2017 Magento, Inc. Create Artifact Push – Build – Tar – Deploy - Run Deployment Push to Git Build Server (or staging) Send to webheads Data Migration Troubleshooting Guide: http://devdocs.magento.com/guides/v2.1/migration/migration-troubleshooting.html Web Head 1 Web Head 2 Web Head 3
  • 29.
    Page | 29©2017 Magento, Inc. Questions? Anyone... email: brent@wagento.com twitter: @brentwpeterson
  • 30.
    Page | 30©2017 Magento, Inc. • Backup database. • mysqldump –u<user> -p <database> > myfile.sql • Restore data and empty all log tables. • mysql –u<user> -p <new_database> < myfile.sql • truncate dataflow_batch_export;truncate dataflow_batch_import;truncate log_customer;truncate log_quote;truncate log_summary;truncate log_summary_type;truncate log_url;truncate log_url_info;truncate log_visitor;truncate log_visitor_info;truncate log_visitor_online;truncate report_viewed_product_index;truncate report_compared_product_index;truncate report_event;truncate sendfriend_log; MySQL backup and restore
  • 31.
    Page | 31©2017 Magento, Inc. Thank you email: brent@wagento.com twitter: @brentwpeterson