Magento migration from version 1 to version 2
Magento is the most popular open-source e-commerce platform for complex and professional e-commerce solutions. Magento is developed on PHP and MySQL (Started on Zend framework). Magento has many unique features which might not be available in other ecommerce platforms. Various companies have relied on magento for their e-commerce solution because it is well designed and flexible. More than 2,40,000 companies or people are using magento for their e-commerce websites.
Why Magento?
1 - Open Source
Magento comes in two flavors, paid version and free open source version. This is why it is appropriate for small, medium and big businesses.
2 - SEO Friendly
In online business, SEO plays a significant role in marketing and company's growth. In magento, we can easily tweak URL and page elements for SEO.
3 - Security
There is always a doubt in the mind of online buyers about money and data security. In Magento, we can manage the security hierarchy at user level, and by managing roles, we can achieve optimum security.
4 - Vast Community
Magento has grown widely over the last few years. It has a vast community of its own, which identifies new needs and develops features accordingly and participate in growing the Magento ecosystem.
Magento 2, the transformed version of the Magento Ecommerce Platform, comes with a brand-new architecture, coding structure, and database design. Support for Magento 1 will end soon. The best minds in the e-commerce development industry are already focused on making Magento 2 a successful e-commerce platform. In this context, the most significant issue is how to manage the migration of Magento from version 1 to version 2.
Four Stages of Migration
According to the official Magento documentation, migration to Magento 2 consists of four stages:
1 - Theme Migration
Magento 2 presents new methodologies and techniques for the delivery of improved shopping and shipping experience to merchants and customers. Developers can take advantage of new ways to create stunning Magento 2 themes or modify the present ones to make them compatible with Magento 2 standards. However, please keep in mind that you can not move your Magento 1 theme to Magento 2 theme straight away, you will need to do all the required adjustments.
2 - Extension Migration
Extensions are essential components that provide new characteristics and enhance the functionality of your Magento shop. The next stage in the Magento migration process is to install the desired Magento 2 extensions from the Magento Marketplace. Remember, Magento 1 extensions will not function on Magento 2. You will experience severe compatibility issues while integrating Magento 1 extensions into Magento 2.
3 - Customizations
In many cases, the custom code used in your Magento 1 store is compatible with Magento 2. Magento provides a Code Migration Toolkit that helps you with this process. It should be observed that due to structural differences between the two platforms, this migration of Magento may require extra work to ensure that the custom code is successfully integrated into the Magento 2 store.
4 - Data Migration
The last action you need to carry during the Magento migration process is to move your Magento 1 settings and data to Magento 2. Magento has formally published Magento 2 Data Migration Tool, which allows developers to migrate their storage information and settings using the CLI commands. Data Migration Tool moves all information from the Magento 1 platform database to the Magento 2 platform database based on a set of guidelines described in XML documents. As of now, only information and settings are transferred through the Data Migration Tool. Magento 1 extensions, themes and other code customizations cannot be automatically migrated to Magento 2 Store.
Differences between Version 1 and Version 2
Since Magento 2 was launched on 17 November 2015, more and more shop owners and companies have began using Magento 2. Of course, Magento 2 will have more advantages than its first version, Magento 1. However, do you understand precisely what the differences are when you compare Magento 1 vs Magento 2?
1 - Technology Stack
Magento 1.0+ | Magento 2.0+ |
---|---|
API Added Retroactively | API is Core to the technology |
Flexible Architecture | New Architecture for Speed |
Open Source | Open Source |
No Front-end Library | Ships with LESS |
Legacy PHP | PHP5.6+ / 7.0 |
No Support for HTML5/CSS3 | Native Support HTML5/CSS3 |
RWD Theme Included | RWD Theme Included |
Weak Content Staging | Advanced Content Staging |
Sub-Par Search (SOLR) | Elastic Search (Commerce Edition) |
External PayPal | In-Site PayPal Experience |
Secure Bridge | PCI Compliance Hosted Fields |
Minimal Video Features | Integrated Video (PDP) |
Full Page Cache (EE) | FPC (Commerce Edition)/Varnish |
2 - Performance
In the e-commerce sector, almost half of customers always expect a website to load in 2 seconds or less. Approximately 40% of internet shoppers will leave a web page that requires more than 3s to load! Magento 2 loading moment is even quicker than the regular 2-3 seconds. Homepage, category pages, and product pages are loaded in less than 1.5 seconds, even without the use of frontend caching. With the new, streamlined checkout, the Magento 2 checkout process has become much more comfortable and faster for customers. Checkout is available to guests without registration, and Magento 2 automatically identifies registered customers on the basis of their email addresses. Registration after the checkout method is also an option and the process has also been streamlined.
3 - Extensions
There are number of third party extensions available on the Magento 1 market. However, installing Magento 1 extension may take a lot of time, even for skilled developers. In addition, conflicts between Magento 1 extensions are settled manually, costing time and effort.
For Magento 2, plugins enable code to overlap with the core code rather than override it. As a result, both the backend and the frontend development have become simpler and the functionality can be modified more easily, thanks to HTML5, Less, require.js, and CSS3.
4 - The support from Magento
The support for Magento 1 is originally scheduled to end in November 2018 and is now being extended by at least 18 months. Support is mostly related to security patches, and important fixes are coming for Magento 1. The risk for Magento 1 users is that there might be an increase in the number of malicious software that target vulnerabilities discovered after the last security patches have been released.
Plan for Migration
From Data Migration to Customize Codes, plan and follow the best practices for migration of Magento version 1 to 2.
These optimal practices are as follows:
- Review all extensions, modules and custom modules. Upgrade you would be using those in future while letting go of extensions which won’t have any use further.
- Build the new dev server and install the new Magento 2.x in it.
- Stop Admin activity and crontabs in Magento version 1
- Start Data Migration.
- Copy the Magento 1.x database to the dev environment.
- Copy media, storefronts and ACLs
- Run all indexes and clear the caches.
- Test Magento site and run for updates.
- End Data Migration
Process In Detail: Magento version 1x to 2x Data Migration
Before you begin the entrails to Magento Data Migration, it is highly essential to keep in mind the below points for a successful migration:
- Refrain from making any changes in Magento 1 Admin except for Order Management.
- Pause all crontab jobs in Magento 1
- Avoid altering any codes
- Don’t make changes in Magento 2 Admin and Storefront.
- Take note of the following versions that are supported for Migration
➔ Community Edition (CE) version 1.6.x, 1.7.x, 1.8.x, 1.9.x
➔ Enterprise Edition (EE) version 1.11.x, 1.12.x, 1.13.x, 1.14.x
The Data Migration from one version to another is carried out with the help of a tool, which acts more like a shell app requiring the Magento 2 Framework to work. The data migration tool for both the Community and Enterprise Edition are available on GitHub for easy access.
After the Magento Data Migration tool installation, the following directory contains the mapping and the configuration file
Configuration
- Choose the right folder based on your Magento version.
- Copy the config.xml.dist to config.xml
crypt_key – Encryption key from Magento 1.X (local.xml).
Mapping Files
Data Migration tools used for mapping files to perform the custom mapping between Magento 1 and Magento 2 including:
- Changes in the table name and field name
- Ignoring tables and fields
- Transferring the table/field
MAP Steps
- Based on the Configuration file chosen, copy the map.xml.dist to map.xml
- Make necessary changes in Config.xml
- Transferring most of the data from Magento 1 to Magento 2
- This step reads instructions from map.xml
Areas
- Source – contains rules of source database
- Destination – contains rules of destination database
Options
- Ignore – document, field or data type marked with this option will be ignored.
- Rename – describes name relations between documents with a different name. In a case when destination document name is not the same with the source document – you can use rename option to set source document name similar to the destination table name.
- Move – sets the rule to move the specified field from the source document to the destination document. NOTE: destination document name should be the same as the source document name. If source and destination document names are different – you need to use rename option for the document that contains moved field.
- Transform – is an option that allows the user to migrate fields according to the behaviour described in the handler.
- Handler – describes transformation behaviour for fields. To call the handler, you need to specify.
Command
bin/magento migrate:
This command does not migrate all configuration settings. Verify all settings in the Magento 2 Admin before proceeding. In case ‘The Migration Completed’ message is displayed, it denotes that the settings have been transferred successfully
The Data Migration Tool saves its current progress as it runs. If errors or user intervention stops it from running, the Data Migration Tool resumes progress from the last known good state.
Media
- All media files (for example, images for products, categories, the WYSIWYG editor, and so on) should be copied manually from
/media to /pub/media. - However, do not copy .htaccess files located in the Magento 1 media folder. Magento 2 has its own .htaccess that should be preserved.
Storefront Design
- Design files (CSS, js, templates, XML layouts) location and format have been changed.
- Layout Updates stored in the database.
ACLs (Access Control Lists)
- You must manually re-create all credentials for web services APIs (that is SOAP, XML-RPC, and REST)
- You must manually re-create all administrative users and associate them with access privileges
After Migration
Start Magento 2 CRON jobs
Flush all Magento 2 cache types
- magento cache:status
- magento cache:enable [type] … [type]
- magento cache:disable [type] … [type]
- magento cache:disable db_ddl full_pagemagento cache:clean [type] … [type]
- magento cache:clean [type] … [type]
- magento cache:flush [type] … [type]
- magento cache:flush –all
Re-index all Magento 2 indexers
- magento indexer:info
- magento indexer:status [indexer]
- magento indexer:reindex [indexer]
Extension and custom code Migration
After successfully migrating Magento version from version 2, you need to:
- Review all the extensions, including third-party and custom extensions.
- Make a list of extensions you are using and check out/buy compatible versions in the Magento Marketplace.
- And in case, the extensions are not available, then you need to migrate the code from Magento 1.x to Magento 2.x using the Magento Code Migration Toolkit, which will help to reduce efforts.
Theme and Customization
Magento 2 follows a new therapy of approaches and architecture for developing themes and customization. If you have installed a theme from a third-party vendor for the Magento 1.x site, then you have to check with the vendor whether the 1.x theme will support Magento 2. Otherwise, we will need to create a custom theme using the Magento 2 frontend developer guide.
Recommendation during Migration
- Use a copy of the database from Magento 1 instance.
- Remove outdated and redundant data.
- To boost performance, you may enable the direct_document_copy option in your config.xml.
Once the Migration is over, we will need to test the Magento 2 store thoroughly to make sure that everything is fine.