Before you start migration,you need to know the server architecture of your Magento1 store. We must aware of the which versions of software our current server is running and which software we need to upgrade while migrating our store.
My Magento1 server configurations are as follows
Operating System : Ubuntu 14.04.02
Apache version : 2.4.7
Mysql version : 5.5.55
PHP version : 5.5.9
PHP modules : mcrypt, curl, gd, pdo,mysql, mysqli, mcrypt, readline, pdo_mysql
Magento version : 1.9.3.2
This is the screen shot of my current Magento1 store
My Magento2 server configurations are as follows
Operating System : Ubuntu 14.04.02
Apache version : 2.4.7
Mysql version : 5.6.33
PHP version : 7.0.19
PHP modules : opcache, pdo, xml, calendar, ctype, curl, dom, exif, fileinfo, ftp, gd, gettext, iconv, intl, json, mbstring, mcrypt, mysqli, pdo_mysql, phar, posix, readline, shmop, simplexml, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip
Magento version : 2.1.6
This is the screen shot of my new Magento2 store.
After migrating from Magento1 to Magento2 we will be able to view the products of the Magento1 store in our new Magento2 store.
Before you start migration, take backup of your Magento1 store files and database
Install Data Migration Tool
Data Migration Tool is a command-line interface for transferring data from Magento1 to Magento2.
Login to your new Magento2 store and goto your magento2 root directory. Suppose my root directory is /home/magento2/www
1 2 3 4 |
su - magento2 cd /home/magento2/www composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool composer require magento/data-migration-tool:2.1.6 # 2.1.6 is my current magento2 version |
It will ask credential for repo.magento.com. After entering the credentials it will update the dependencies.
Data Migration Tool operates mainly 3 modes of operation
- It will migrate the store configurations to the new store
- It will migrate your database
- It will transfer incremental data updates while new data added to Magento1 storefront and admin panel while running previous migration modes
Migrate your store configuration
Both Magento1 and Magento2 are the community editions and my Magento1 version is 1.9.3.2. So I need to create config.xml according to this.
1 2 3 |
# my present working directory is /home/magento2/www cp vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.2/config.xml.dist vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.2/config.xml cp vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.2/map.xml.dist vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.2/map.xml |
Configure your database connectivity. Open vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.2/config.xml and make the following changes.
1 2 3 4 5 6 7 |
<source> <database host="192.168.1.53" name="mage1db" user="mage1" password="mage1"/> </source> <destination> <database host="localhost" name="mage2db" user="mage2" password="mage2"/> </destination> |
In source filed give all the information about Magento1 database and in destination field give all the information about the Magento2 database.
Now, run the following command to migrate your settings.
1 |
php bin/magento migrate:settings vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.2/config.xml |
This will migrate your configuration setting.
Migrate your Database
We have already config.xml file. We just need to run the command to migrate the data.
1 |
php bin/magento migrate:data vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.2/config.xml |
There may be some issue while migrating your database.
This issue occurs because some tables in the Magento1 are not present in Magento2. You need to check which tables or which fields are missing. Then you need to manually create the table and fields.
For example, compare these two tables
Magento1 store database
Magento2 store database
In Magento2 database two columns name and visibility are missing. So we need to add these two columns manually. After creating the other missing fields and tables we will be able to migrate the data.
If you want to skip some of the migrating steps, you can comment the steps in config.xml file
I want to skip the EAV step, so I have commented the lines for EAV step.
Migrate changes
Now it is time to migrate the additional data that added to the store since last time we migrated the data. The data may be customer order,reviews,transactions and small changes in the backend.
To run the incremental migration, run the following command
1 |
php bin/magento migrate:delta vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.2/config.xml |
It will run continuously until you press CTRL+C . When you think you have migrated the additional data, press CTRL+C and stop the process.
Copy media files
Now copy the media files from Magento1 store to Magento2 store
1 |
rsync -rv magento1@192.168.1.53:/home/magento1/www/media/ /home/magento2/www/pub/media/ --exclude '.htaccess' |
Post Migration Task
After migration put Magento1 in maintenance mode and stop backend tasks.
Start Magento2 cron jobs.
Flush Magento2 cache and reindex all the indexer.
1 2 |
php bin/magento cache:flush php bin/magento indexer:reindex |
Restart your apache/nginx services and make your new Magento2 store live.
After migration my new Magento2 store look like this
This is all about migrating your Magento1 store to Magento2. If you have any doubts regarding procedure you can ask me in the comment.