1

I am new to Magento2, I need some guidance from magento geeks for migrating data from magento1 to magento2.

Quick Overview
I received a system that was built in magento2 from scratch. So I think there is no need to migrate the Themes, Extensions and other things except data from magento1 system as described in docs (see link below).

https://devdocs.magento.com/guides/v2.0/howdoi/migrate/migrate.html

I tried to read this link, and finally reached to this point where I have no understanding of settings.xml (see link below) file i:e which files I need to ignore, and which to include (That's the main issue)

https://devdocs.magento.com/guides/v2.0/migration/migration-tool-internal-spec.html#settings-migration-mode

Can someone please help me understand, what is the best way to migrate data/settings from Magento1 system to Magento2.

Feedback is much appreciated!!

1
  • please check my ans for step by step information about migration. Commented Aug 31, 2018 at 4:37

1 Answer 1

5

Please check following steps for DATA MIGRATION FROM MAGENTO 1 to MAGENTO 2

Setup m1 database and setup m2 project

Before start migration please install fresh magento, Also put magento1 database and Magento2 database on same server

Stpe 1:

Install datamigration tool in fresh Magento
composer require magento/data-migration-tool:2.2.5

Step 2:

Go to to this Directory "{your_root_directory}/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.2.4(Magento 1 version)/"
Rename file config.xml.dist to config.xml (remove .dist from end)
Rename file map.xml.dist to map.xml (remove .dist from end)

Step 3:

Open config.xml (From this directory "{your_root_directory}/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.2.4(Magento 1 version)/config.xml")

Set database name, username and password on line number approx 100

//Magento 1 database access
<source>
    <database host="localhost" name="mad1live" user="root" password="mysql123" />
</source>

//Magento 2 database access
<destination>
    <database host="localhost" name="mad2migration" user="root" password="mysql123" />
</destination>

Remove .dist from map.xml.dist on this line no approx 107 
Code after edit : <map_file>etc/opensource-to-opensource/1.9.2.4(Magento 1 version)/map.xml</map_file>

Copy crypt key from magento 1 /app/etc/local.xml and set in config.xml Example:

<options>
    ...
    <crypt_key>f5c82fa911418341aec329db9f798f81</crypt_key>
    ...
</options>

Step 4: Run folllwing commands one by one.

sudo php bin/magento migrate:settings -r {{path_to_your_root_directory}}/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.2.4/config.xml

sudo php bin/magento migrate:data -r {{path_to_your_root_directory}}/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.2.4/config.xml

sudo php bin/magento migrate:delta -r {{path_to_your_root_directory}}/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.2.4/config.xml

sudo is also not necessary in commands.

5
  • Awesome guidline, its very helpful to me. Thanks @Aasim
    – user59799
    Commented Aug 31, 2018 at 4:33
  • Very nice explanation, @Aasim what if I don't want to do this as a fresh Install of Magento2. My Magento2 application is already complete. Do you think that I should copy all the theme/css/js changes after migrating data from M1-M2 as a fresh install of M2? Commented Sep 3, 2018 at 10:23
  • @IrfanAhmed I never tried that but I think that should work, please try and let me know if you get any error. Commented Sep 4, 2018 at 4:19
  • @AasimGoriya I follow your migration step but settings command run after SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'principal' for key 'STORE_GROUP_CODE' Commented Feb 22, 2019 at 5:40
  • @AasimGoriya,I migrated all data successfully, I need to skip orders, only need to migrate products and customers Commented Apr 15, 2019 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.