How to transfer data from Magento 1 to Magento 2
Below are examples of scripts that can be used to transfer data from a Mirasvit Affiliate for Magento 1 to a Mirasvit Affiliate for Magento 2.
To use scripts, you will need the help of a PHP developer. Scripts may contain bugs and not transfer all necessary data, meaning that you may need to adjust them for your needs.
Migration service is not a part of our support service.
Click on the names of scripts below to download:
mirasvit_affiliate_m1_export.php
- script for exporting Magestore Affiliate data to XML file.mirasvit_affiliate_m2_import.php
- script for importing Affiliate data from XML file.
How to perform migration
Prepare for migration
- Run standard Magento 2 migration, and make sure that customers and orders have been transferred from your M1 store to M2.
- Make sure that the Affiliate for Magento 2 is installed on your M2 store.
Execute the following commands for migration
-
To export, place
mirasvit_affiliate_m1_export.php
to the root of your M1 store, and run export from the browser by opening the URL:http://store_m1.com/mirasvit_affiliate_m1_export.php
Alternatively, if you want to export from the SSH/Console: navigate to your store's root and run the command below:
php -f mirasvit_affiliate_m1_export.php
-
If the script returns success, the file
affiliate_export.xml
will be created at the root of the store with all of your data. Transfer it to the root of your M2 store. -
To import, place
mirasvit_affiliate_m2_import.php
to the root of your M2 store, and from the browser by opening the URL:http://store_m1.com/mirasvit_affiliate_m2_import.php
Otherwise, navigate to your store's root and run the following command from the SSH/Console:
php -f mirasvit_affiliate_m2_import.php
-
Check migrated data.
-
When the migration is completed, remove both migration scripts.
Troubleshooting
In some cases, the import script can crash on timeout or a memory overloading error (due to large quantities of data). In this case, you should restart the import script by reloading the browser page. It will skip previously uploaded data, and proceed from the last unprocessed record.