Migrate Magento 1 to Magento 2 using Data migration tool?

Magento2 version of the Magento transformed ecommerce platform with a brand new architectures, coding structures and database design.Magento1 support will end soon so best thing in the ecommerce development industry are focus on making Magento2 a successful ecommerce platform.

Before starting Data Migration from Magento1 to Magento2 follow the recommendations below:-

Step-01:-Take a full backup of the Magento1 store including all files, folders, and database.

Step-02:-Clone the Magento1 database.Do not migrate live store data directly.

Step-03:- Open the phpmyadmin and create the database table where you want to import the database.

Step-04:-Open terminal the paste the following code to import magento1 database.

mysql -u username -pPassword new_database_db <old_magento1_database.sql

Example:-

Username = root;
Password = admin@123
New Database name create in database in phpmyadmin = magento1_db Old database name = old_magentodatase.sql

mysql -u root  -padmin@123  magento1_db < old_magentodatase.sql

Step-05:-After that again go to phpmyadmin and create a new database name to install fresh magento2.

Example: I create new database magento2_db.

Step-06:-Then install fresh Magento2.
Go to bin folder in Magento2 folder and open terminal.
/var/www/html/magento2/bin

Paste the following code to terminal after edit the following data of code like base url,host,database password,email etc as your requirement to install fresh Magento2:-

php -d memory_limit=10G   magento setup:install --base-url=http://127.0.0.1/magento2/ --db-host=localhost --db-name=magento_sample_db --db-user=root  --db-password=abc123 --admin-firstname=Your_name --admin-lastname=Last_name [email protected] --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1

Step-07 :- After complete install fresh Magento2 to migrate database install Migration tool using Git.

Follow the below steps:-After complete install fresh Magento2 to migrate database install Migration tool using GitFollow the below steps:-

If you did not have a git in your system then install it.

sudo apt-get install git

Before install migration tool you have to know the version of Magento.To know the version paste the following code to terminal.

php bin/magento --version

Step-08:Run the following command to install Data Migration Tool.

composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool
composer update
Terminal view one
Terminal view two

Step-09:- To get user name and password we have to create public key and private key login https://marketplace.magento.com. Then go to Marketplace-> Access Keys.

Step-10:- Create Access Key using Create A New Access Key.Use Public Key as Username and Private Key Password .(You can use existing Public and Private Key if u already created).

Step-11:- Then run following command with Magento2 Version.

composer require magento/data-migration-tool:<version>

as

composer require magento/data-migration-tool:2.3.4
Terminal view 3

Step-11:- After installation data-migration-tool go to /vendor/magento/. Now you will see data-migration-tool folder.


Then choose version of Magento in path /vendor/magento/data-migration-tool/etc/opensource-to-opensource

Step-12:-Chose version of Magento1 and Copy config.xml.dist make config.xml

Example i choose 1.9.3.1

Step-13:Now open config.xml.

Find this following code-

<source>
        <database host="localhost" name="magento1" user="root"/>
    </source>
    <destination>
        <database host="localhost" name="magento2" user="root" />
    </destination>

Then edit the code of database name,password and user,like as example below-

<source>
        <database host="localhost" name="oldmage1_db" user="root" password="admin123" />
    </source>
    <destination>
        <database host="localhost" name="newmage2_db" user="root" password="admin123" />
    </destination>
Screen one

Step-14:- Find the <crypt /> tag in config.xml and give the crypt of magento1 which you can find in your magento1 project whose database you want to migrate.

Go to Magento1 folder->app/etc/local.xml.

You will see like this:-

<crypt>
<key><![CDATA[f1f657cb301c23dk783a8398051a37yh]]></key>
</crypt

now copy the key and paste in config.xml and paste in .

like as Example:-

<crypt_key >f1f657cb301c23dk783a8398051a37yh</crypt_key>

screenshot of config.xml

confure config.xml

Step-15:- Finally run this two command in terminal to complete Migration.Step-15:- Finally run this two command in terminal to complete Migration.

php -d memory_limit=10G bin/magento migrate:settings -r -a /var/www/html/nationmaze/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.1/config.xml 
php -d memory_limit=10G bin/magento migrate:data -r -a/var/www/html/nationmaze/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.1/config.xml
Migrate Magento 1 to Magento 2 using Data migration tool

Enjoy the blog

Total Page Visits: 25353 - Today Page Visits: 10

Leave a Reply