Tips and tricks in Magento 2 data migration

  • Slides: 15
Download presentation
Tips and tricks in Magento 2 data migration tool Razvan Avramescu - Magento Developer,

Tips and tricks in Magento 2 data migration tool Razvan Avramescu - Magento Developer, Toptal • 16. 10. 2018

What is data migration tool Data Migration Tool is a command-line interface used for

What is data migration tool Data Migration Tool is a command-line interface used for transferring data from Magento 1 to Magento 2. Overview It does not include any custom code migration which is a different step when moving from old system to the new one. It can a better alternative for basic export / import functionality and it should deal better with some the logic changes, for example creating url rewrites using the new framework technique.

Definitions Source Document Old Magento 1 database. My. SQL Table Destination Field New Magento

Definitions Source Document Old Magento 1 database. My. SQL Table Destination Field New Magento 2 database. My. SQL Column

Before you start Magento 1 ● Backup live database. ● Always use a copy

Before you start Magento 1 ● Backup live database. ● Always use a copy of live database to test the setup. ● If your media are stored in the database, use synchronize in Storage Configuration. Magento 2 ● Read magento documentation and pay attention to every detail. ● If you want to use Delta for bringing updates later on, use the live db, assuming setup was very well tested.

What to expect Expected ● ● Reserve time for it and prepare it, is

What to expect Expected ● ● Reserve time for it and prepare it, is not actually a few hours task. Ensure you have enough resources get familiar with terms such as `max_allowed_packet` and `wait_timeout`. Unexpected ● There might be issues with source data. ● There might be issues with migrated data.

Main data to be migrated Entities ● Products ● Configurations ● Categories (and its

Main data to be migrated Entities ● Products ● Configurations ● Categories (and its products relations) ● CMS elements ● Websites, Store groups, Stores ● Media assets for Products, Categories, CMS ● Customers ● Orders

Some data must be transformed Besides the transformation logic handle by the tool, there

Some data must be transformed Besides the transformation logic handle by the tool, there might be other data that must be transformed ● Values must be changed to match Magento 2 new classes models (namespace). ● Some values must be nulled even if are empty for consistency in the destination. Also some attributes are now required.

Schedule

Schedule

Install fresh magento copy and data migration tool I Run migration Settings, Data and

Install fresh magento copy and data migration tool I Run migration Settings, Data and Delta in this exact order. II Configure migration III Regression test against CRUD operations and system configuration IV Backup Magento 2 V

Next steps Fix system configurations errors if any It might worth the time to

Next steps Fix system configurations errors if any It might worth the time to actually restore a clean installation system configuration. Check Magento 2 github issue tracker Sometimes can save debug time. Bring Media files Media folder needs to be copied manually.

Tips ● Data migration should be the first task, over a clean Magento 2

Tips ● Data migration should be the first task, over a clean Magento 2 installation. ● Take the errors during migration as something helpful to the process. ● Use -vvv for extended debugging. ● Magento 1 instance can be live during migration, especially if you need later on to bring delta (updates). ● Some of the attributes might be required in M 2 and are not in M 1 (telephone).

Tips ● Backup mysql database in the process before any step. ● A good

Tips ● Backup mysql database in the process before any step. ● A good idea is to script repeatable process: drop database, create database, import database backup. ● The versions of the Data Migration Tool and Magento must exactly match. Do not upgrade Magento 2 until migration is complete. ● Use -r to restart process.

Tips ● Create separate from core data-migration config files. ● Try not to delete

Tips ● Create separate from core data-migration config files. ● Try not to delete entities in Magento 2 until you finish with migration, running Delta might not work. ● The last but not the least, Make sure you do not lose the configuration files until you go live with Magento 2.

1. Migrate extensions and custom code. Setup next goals 2. Migrate themes. 3. Migrate

1. Migrate extensions and custom code. Setup next goals 2. Migrate themes. 3. Migrate customizations. 4. Run delta if you want to bring Magento 1 updates (backup first).

Thank you!

Thank you!