Tuesday 29 January 2019

How To Migrate Magento 1 To Magento 2

Step 1 : Get full backup of your Magento 1 store including all files, folders, and the database

Step 2 : Create a clone of your Magento 1 store. Do not use your live store for Magento migration process

Step 3 : Check your store. Keep what you think is necessary and delete the rest

Step 4 : Check whether your current theme(s), extensions and custom code are compatible with the Magento 2 or not.

Step 5 : Create clone of Magento 1 database and connect with new(clone) magento 1.

Step 6 : Remove useless data from the database including logs, recently viewed products, compared products, etc.

Step 7 : To make Magento migration process as hassle-free as possible, install a fresh and latest copy of Magento 2 on the same hosting server where your Magento 1(cloned) store is located.

Step 8 : To find the version of your store, navigate to the root directory of your Magento 2 via SSH and enter the following command:
php bin/magento --version
Step 9 :
composer config repositories.magento composer https://repo.magento.com
composer require magento/data-migration-tool:2.3.0
You will be asked to enter your developer authentication keys. Go to the Magento Marketplace. Sign in using your login credentials, go to your profile and then click Access Keys under My Products section.

If you already have keys then, your public key will be your username and the private key will be your password. Otherwise, create a new key pair by clicking the Create a New Access Key button.

In a few seconds, the Data Migration Tool will be successfully installed on your Magento 2 store.

Configure Magento 2 Data Migration Tool


Step 10 : Goto <Magento 2 root dir>/vendor/magento/data-migration-tool/etc/opensource-to-opensource/<Magento 1.x version> and rename config.xml.dist to config.xml

Step 11 :

Next, open config.xml in your favorite code editor and specify the following:

<source>

<database host="localhost" name="Magento1-DB-name" user="DB-username" password="DB-password"/>

</source>

<destination>

<database host="localhost" name="Magento2-DB-name" user="DB-username" password="DB-password"/>

</destination>

<options>

<crypt_key>Magento1-Encrypted-Key</crypt_key>

</options>

In the above code, <source> has the database information of Magento 1 and <destination> has the relevant database information of Magento 2. <crypt_key> is mandatory and needs to be filled prior run. It is the encryption key of Magento 1 store and can be found in the <Magento 1 root dir>/app/etc/local.xml file, within the <key> tag.

When finished, save the config.xml and you are done.

Migrate Settings Using Magento 2 Data Migration Tool


Here is how you can use the Data Migration Tool to migrate settings from Magento 1 to Magento 2. These settings include stores, websites, system configurations such as shipping, payment, tax settings, etc.

According to the Magento Data Migration Order, you should migrate settings first. To start migrating the settings, navigate to your Magento 2 root directory via SSH terminal and run the following command:
php bin/magento migrate:settings --reset <path to your config.xml>
where <path to your config.xml> this would be vendor/magento/data-migration-tool/etc/opensource-to-opensource/<Magento 1.x version>/config.xml. I have used --reset argument in the above command which forces the Data Migration Tool to start from the beginning.

Once the settings migration is over, a successful message will be displayed.


Migrate Data Using Magento 2 Data Migration Tool


Data migration from Magento 1 platform to Magento 2 platform includes products, categories, orders, customers, wish lists, ratings, etc. To migrate data, run the following CLI command:
php bin/magento migrate:data --reset <path to your config.xml>
As this command runs, the Magento 2 Data Migration Tool saves its current progress, and in the case of an error, stop the process and resume from the last known good state. Also, the Magento 2 Data Migration Tool may report some errors during the migration. In such a case, refer to the Troubleshooting page of the Magento 2 Data Migration Tool for further assistance.

Step 12 : Finish and check Your Magento 2 store


How to install Extension in PHP 7.2 | PHP 7.1 | PHP 7.0 in Ubuntu 16.04 | Ubuntu 18.04

Open terminal or cmd and put following command
apt install php7.2-soap
apt install php7.2-bcmath

Thursday 24 January 2019

How to dump Magento 2 Enterprise Edition Database

  1. curl -sS https://accounts.magento.cloud/cli/installer | php
  2. magento-cloud list
  3. login without root
  4. magento-cloud db:dump
  5. Open login URL in browser like : http://127.0.0.1:5000
  6. Update to version 1.23.0? [Y/n] y
  7. Continue? [Y/n] y
  8. Enter a number to choose a project:
    1.  [0] ProjectName (Project) (tx2ia23dv5uk)
    2.   Environment ID [staging]: (Press enter key)
  9. Enter a number to choose a relationship:
    1.   [0] database
    2.   [1] database-slave
  10. (Press 0 and Enter key)