Thu, 19 May 2016
The day when you finally made a decision to transit your web store to Magento 2 has come! Congratulations! Although this upgrade can be a serious challenge for your development team, it is absolutely worth every minute and every dollar spent, as it will bring your web shop to a whole new level. The official Magento case study declares that the amount of time required to perform a migration is less than 10 hours (Settings migration time: ~10 mins; Data migration time: ~9 hrs). Oh well.. be ready to spend much more time in real life as it is definitely not a "one-click" operation. The essential differences in architecture and theming alone dictate their own rules, which may end up in almost re-building your Magento store. But let's focus on a major advantage of this situation - it offers a great opportunity to clean out bad configurations, data and content. Magento 2 has a lot of benefits, it's much easier platform to maintain and extend.
Magento 2.0 upgrade involves four components:
Migration of the core data (products, customers, orders, store configurations, promotions) is quite simple. But there are a lot of pitfalls in extensions, themes and customizations transition.
You can find a detailed migration guide in Magento Developer Documentation 2.0. We have taken a liberty to simplify it and add some practical tips based on experience of our team, so here we go!
We'll cover upgrading Magento with the Data Migration Tool. (How to Install the Data Migration Tool) How it works? This tool identifies the differences in database structure between versions of Magento. Most of them are declared in map files. Each step in the process uses map files to transform data for the use in Magento 2 store. For example, you need to move a table. If the table was renamed appropriately, the map file detects it and the Data Migration Tool will transfer it Magento 2 database. To learn more about mapping files, refer to Data Migration Tool Internal Specification.
How migration looks in general:
Image Source: http://devdocs.magento.com/guides/v2.0/migration/migration-overview-how.html
The main reason of any failures is messed data, so in order to avoid it you need to create detailed migration plan.
Step 1. Create detailed migration plan.
Step 2. Estimate the current state of your site:
Step 3. Capacity
Step 4. Complete migration budget. General Magento update to 2.0 costs from $5,000 to $15,000, but in some cases it rises higher than $50,000.
Step 5. Install and test Magento 2:
Step 6. Install the Data Migration Tool
Step 7. Upgrade the Data Migration Tool. The versions of the Data Migration Tool and Magento must match, meaning that if you're running Magento 2.0.2, you must use the Data Migration Tool 2.0.2.
Step 8. Configure migration. Before you migrate any data, you must create a
config.xml configuration file from the provided sample.
Step 9. Let's start the migration itself:
NOTE: Activity cannot resume until your Magento 2 store goes live.
Transfer settings with migration tool]10
`bin/magento migrate:settings <Magento2 Directory>/vendor/magento/data-migration-tool/etc/ce-to-ce/126.96.36.199/config.xml`
Manually copy your Magento 1.x media files to Magento 2.0.
All media files (for example, images for products, categories, the WYSIWYG editor, etc.) should be copied manually from
<your Magento 1 install dir>/media to
<your Magento 2 install dir>/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.
Bulk copy your data from Magento 1 database to Magento 2 database with the Data Migration Tool.
`bin/magento migrate:data <Magento2 Directory>/vendor/magento/data-migration-tool/etc/ce-to-ce/188.8.131.52/config.xml`
Migrate Magento 1 extension code to Magento 2
Reindex all Magento 2.0 indexers.
Test your Magento 2.0 site.
Step 10. Incremental updates
Migrate the delta data (new orders, reviews, customer profiles) and migrate them to the new one.
`bin/magento migrate:delta -r <Magento2 Directory>/vendor/magento/data-migration-tool/etc/ce-to-ce/184.108.40.206/config.xml`
Test your new store.
Press Control+C to stop incremental migration and start it again after issues are resolved
Step 11. Go live
To avoid compatibility issues after modules, themes and customizations transition let's pay attention on some useful Magento 2 upgrade hints.
<your Magento 1 install dir>/mediato
<your Magento 2 install dir>/pub/media
.htaccess files located in the Magento 1
media folder. Magento 2 has its own
.htaccess that should be preserved.
Factories are autogenerated.
For quick object creating at runtime you can take the model class, add Factory in the end, put in your constructor and call create().
then further down:
$error = $this->rateErrorFactory->create();
Observers In Magento 2 observers have no direct impact on the flow.
All replaced with using the DI entities. E.g.
$this->addressConfig->foo() instead of
Quick Mappings Quick migration tips
Copying actually isn't a bad idea For easy migration with the Data Migration Tool you need to have the same structures in Magento 1.x and in 2.x. The problem is that they differ a lot. So open 2 PHPStorm windows one with M1 and Other with M2. Search for similar functionality to what is going on in the extension in the core code and COPY it.
The use of the вЂ__construct' method. When you're adjusting an M1 module to M2, add the construct method. It is used to load any required classes, set variables, and more depending on what the class is doing.
app/design/frontend/, M2 has increased the modularity of themes by including ALL theme files within the same directory.
Good luck in migration to Magento 2! In case you need any assistance, don't hesitate to contact us and our certified Magento developers will upgrade your web store.