Today, we’re going to teach you guys how to use Code Migration Develop tool for code migration from Magento 1 to Magento 2.
This tool was specially built for Magento users.
By using this tool, you can easily migrate your code from Magento 1 to Magento 2 platform.
And in this tutorial, we’re going to show you the step-by-step process to migrate code from Magento 1 to Magento 2.
Steps for Magento 2 Code Migration from Magento 1 with Code Migration Tool
To successfully migrate your code from Magento 1 to Magento 2 platform, please follow the below steps.
Step 1. Download Code Migration Toolkit from GitHub.com as a .zip file.
Step 2. Unzip the downloaded file in your local directory.
Step 3. Login to your server through Shell.
Step 4. Switch to the folder where you unzipped the file by executing the following command:
cd "/path-to-/code-migration-develop"
Step 5. Execute the following command in the root directory of the same folder:
composer install
Step 6. Switch to the bin directory under the code-migration-develop folder by executing the below command:
cd bin
Step 7. Execute the following command to convert the code structure:
php migrate.php migrateModuleStructure /path-to-your-magento1.x-installation /path-to-your-magento2.0-installation
Step 8. Execute the following command:
php migrate.php convertLayout /path-to-your-magento2.0-installation-directory
Step 9. Run the following command to finish the process:
php migrate.php convertPhpCode /path-to-your-magento1.x-installation /path-to-your-magento2.0-installation
Let's learn each step in-depth.
Step 1
First of all, download the code-migration-develop tool as a .zip file into any folder of your system from github.com.
Step 2
After that, Unzip the downloaded file in your local directory. Remember, do not unzip the file where you’ve installed your Magento.
Step 3
Now, login to your server through Shell.
Step 4
Next, switch to the folder where you unzipped the file by executing the following command:
cd "/path-to-/code-migration-develop"
Step 5
After that, execute the below command in the root directory of the same folder.
composer install
Also read: How to Install and Configure Magento 2 Data Migration Tool?
Step 6
Now, allow the composer to finish its job.
Once it is done, switch to the bin directory under the code-migration-develop folder by executing the below command:
cd bin
Step 7
Next, execute the following command to convert the code structure.
php migrate.php migrateModuleStructure /path-to-your-magento1.x-installation /path-to-your-magento2.0-installation
You can see the converted code structure in the code-migration-develop/app/code directory.
Step 8
Now, the next step is to execute the below command:
php migrate.php convertLayout /path-to-your-magento2.0-installation-directory
Step #9
Lastly, run the following command to finish the process:
php migrate.php convertPhpCode /path-to-your-magento1.x-installation /path-to-your-magento2.0-installation
And that’s about it!
NOTE: During the last step, you might see some warnings. These warnings will occur because the code-migration-develop tool is not capable to do everything on its own.
There will be some manual work that you’ll need to do.
You can easily identify these warnings in the log file /code-migration-develop/var/migration.log from where you can perform the remaining manual code migrate job.
Conclusion
That’s it! This is how you can migrate code from Magento 1 to Magento 2 platform using the Code-Migration-Develop tool.
We hope that you found this tutorial helpful. If you have any queries or doubts, please ask them in the comments below.
And if you need our professional assistance with code migration from Magento 1 to Magneto 2, feel free to contact us at any time.