Magento 2 Migration: A Step-by-Step Guide for Upgrading Your Store

Welcome to the second part of the Magento migration guide.

In the previous part, we discussed creating a new UX and UI for the store. Let’s move on to the next phase.

The Process of Magento 1 to 2 Migration

This is the most time-consuming part of the Magento 1 to 2 migration process. This is also about using the design we have developed in the previous step.

Once that’s done, then you address various compatibility, bugs, and other performance issues to make the store perform better and more efficiently.

Steps involved in Magento 1 to 2 Migration

The following are the major steps in migrating the Magento store 1 to 2:

Steps involved in Magento 1 to 2 Migration
  • Assess, develop, install, and test extensions that need to be used.
  • Use the help of expert front-end developers to make the design elements correctly apply to the latest version of Magento.
  • Decide the backend tasks based on the changes you want to make to the store.
  • Evaluate and decide the number of integrations you need and build the same.
  • Optimize the store at the end for performance, speed, and security.

Step #1. Prepare for the Migration Process

This is where you need to set your technology infrastructure and other technical elements ready for the migration process. As per the version of the Magento platform you use, the software’s requirements will change.

If you are using Magento 2.3.X:

  • You must use the PHP version 7.3.X.
  • You must use the MySQL database version 5.7 or the MariaDB database version 10.2.

In addition, you must also use PHP extensions, such as bc-math, ctype, openssl, curl, dom, gd, iconv, intl, json, hash, xsl, zip, libxml, mbstring, SimpleXML, soap, PDO/MySQL, and spl.

If you are using Magento 2.4.X:

  • You must use the PHP version 7.4.X.
  • You must use the MySQL database version 5.7.9 or 8.0 or the MariaDB database version 10.2 or 10.4.

In addition, you must also use PHP extensions, such as bc-math, ctype, openssl, curl, dom, gd, iconv, intl, json, hash, xsl, zip, libxml, mbstring, SimpleXML, soap, PDO/MySQL, and spl.

You also need the Elasticsearch version 7.9.X advanced search solution.

Regarding hardware, you must have a minimum RAM of 2GB, or you won’t have enough space for the code to run. If you need smoother store functioning, you can also use SSD technology with 24GB+.

You also need to remember that Magento 2 migration needs to happen to the latest version available now, which you can download from the official website.

Step #2: Configure Your Data Migration Tool

From our experience as a pioneer Magento migration agency, we recommend you use the standard tool to migrate Magento 2 from Magento 1. When doing so, you must create specific code to ensure smooth and efficient migration.

If you have custom data in your store, you must make changes accordingly to move this data successfully. These could be columns and tabs that are not a part of the standard dataset of Magento.

Here is a quick guide on how to do this.

  • Install the Magento migration tool using the code given below:
root# composer require magento/data-migration-tool:2.4.2 ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 1 install, 0 updates, 0 removals - Installing magento/data-migration-tool (2.4.2): Downloading (100%) Writing lock file Generating autoload files
  • Make changes to Magento 2 migration tool in the corresponding directory that you can find in the root folder of Magento 2. You must now copy the configuration file for your Magento 1 store.
vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.x

Replace the version from 1.9.x with the Magento 1 version you have running for your store. In addition, if you change the edition of Magento, you need to make changes accordingly.

Now, you need to specify from where and to where the data needs to be migrated. You must do this in the config.xml file. For example:

<source> <database host="localhost" name="m1" user="m1" password="m1"/> </source> <destination> <database host="localhost" name="m2" user="m2" password="m2"/> </destination>

In the next step find the options tag and add the crypt_key in the field.

<options> …… <crypt_key>85ba8337149597a561bee04ec6c9a347</crypt_key> …… </options>

You must place the crypt_key of the Magento 1 site within the app/etc/local.xml file. You can find this in the root folder of your store.

<config> <global> <install> <date><![CDATA[Wed, 17 Feb 2021 21:29:35 +0000]]></date> </install> <crypt> <key><[CDATA[<strong>85ba8337149597a561bee04ec6c9a347</strong>]]></key> </crypt> <disable_local_modules>false</disable_local_modules> <resources>

Related Article: A Detailed Guide to Find the Best Web App Development Partner for Your Startup?

Step #3: Configuring the Settings and Migration

In this stage, you are looking to migrate the existing settings and data from Magento 1 to Magento 2.

Follow the steps given below:

  • Execute the following in the root folder of Magento 2.
php bin/magento migrate:settings vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.x/config.xml

The following is what you will get after executing the above:

[2021-02-17 18:22:22][INFO][mode: settings][stage: integrity check][step: Settings Step]: started 100% [============================] Remaining Time: < 1 sec [2021-02-17 18:22:22][INFO][mode: settings][stage: integrity check][step: Stores Step]: started 100% [============================] Remaining Time: < 1 sec [2021-02-17 18:22:22][INFO][mode: settings][stage: data migration][step: Settings Step]: started 100% [============================] Remaining Time: < 1 sec [2021-02-17 18:22:24][INFO][mode: settings][stage: data migration][step: Stores Step]: started 100% [============================] Remaining Time: < 1 sec [2021-02-17 18:22:24][INFO][mode: settings][stage: volume check][step: Stores Step]: started 100% [============================] Remaining Time: < 1 sec [2021-02-17 18:22:24][INFO][mode: settings][stage: volume check][step: Stores Step]: Migration completed
  • The above example is a basic representation. However, if your case requires a bit more in-depth and detailed configuration, you must make changes to the configuration settings file.

(vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.x/config.xml). You can do this as given below:

<settings_map_file>etc/opensource-to-opensource/settings.xml.dist></settings_map_file>
  • Always remember that before you make the necessary edits, you must copy this to the settings.xml.
  • Now, check how the config.xml file has been named and ensure it is correctly named.
<settings_map_file>etc/opensource-to-opensource/settings.xml.dist></settings_map_file>
  • If you want to ignore some of the settings in the settings.xml file, you can run the following code for the desired results.
<ignore> <path>path/to/setting</path> </ignore>
  • You can use the following code if some of the settings from the settings.xml file need to be renamed from their original name.
<rename> <path>crontab/jobs/system_backup/schedule/cron_expr</path> <to>crontab/default/jobs/system_backup/schedule/cron_expr</to> </rename>

Step #4: Developing Custom Functionality

In this step, you must develop custom functionality for your Magento store. This is a rather extensive and intensive process. You must hire a Magento development agency to help you with this to avoid bugs and issues further down the line.

A chief part of this step involves creating scripts for your website, which needs to be done from the ground up. However, some custom codes can be migrated from your older store to the new one.

If you want to do that, you can use a tool like Magento Code Migration Toolkit. The tool helps you with scripts to convert custom Magento 1 codes to Magento 2 codes for easy and quicker migration.

In doing so, the tool manages the following aspects of the current code in the migration process:

  • Config XML files
  • PHP files
  • Layout XML files
  • Module directory structure

However, you may still be required to edit some of the code for better results manually.

Step #5: Create New Modules or Find Replacements for Current Ones

While migrating from one platform to another, finding all the modules for the new platform you have used for the previous ones is impossible. Hence, you may need to find replacements for a few, create new ones for another, and compromise in other cases.

When looking for the same modules for the Magento 2 store, you have the following options:

  • Available for both Magento 1 and 2 in the Magento Marketplace.
  • Available for Magento 1 but not for Magento 2 in the Magento Marketplace.
  • Extensions that you need to create from scratch for the Magento 2 platform.

The best way to make the right choice is to conduct an extensive analysis of the extensions and the option you want to proceed with before the migration process.

Moving from Magento 1 to 2 is your best chance to declutter your store and make it more efficient and better performing.

Conduct Magento 2 plugin testing

After finding the right replacement for the current functionalities of your platform, the next step is to test the Magento 2 modules. In this stage, you must hire QA engineers and work with specifications and internal documents.

When AddWeb Solution carries out this process, we focus on the following:

  • We test every module for its functionality
  • Test how the module affects the functionality of Magento 2
  • Carry out load testing to understand the store’s performance
  • Check mobile and cross-browser performance
  • Test the third-party compatibility of the extensions used
  • Conduct thorough security testing
  • Carry out testing in production mode

Step #6: Configuring the Servers

When migrating Magento from version 1 to 2, configuring the servers adequately is crucial. Magento 2 is slower than the previous version, making it necessary for a few caching tools like Varnish if necessary.

Varnish creates a layer between your store and its users, accelerating your site speed, improving performance, and optimizing your Magento 2 platform.

You can also combine Varnish with a CDN to present your content faster and more quickly. As media files take a lot of your page’s load, using a CDN can load them faster using the caching technique.

Step #7: Magento 1 to 2 Data Migration

You must migrate five types of data to complete the migration process. These are:

  • Customer data
  • Store settings
  • Order data
  • Product data
  • 3-party extension data

Migrating each of these data categories takes a lot of time, and you need to have a Magento migration agency with you to oversee the effective completion of the process.

Migrating the initial data

Here you migrate the basic data on your Magento store, such as customer information, products, orders, users, etc. You can use an example command, as given below.

# php bin/magento migrate:data vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.x/config.xml

Media files migration

You must transfer your media files manually for an error-free migration. However, there are many Magento stores that keep their media files in a database. In this case, you can sync the data to ensure automatic migration to Magento 2.

You can do this by following the path below:

Backend menu of Magento 1 → System → Configuration → Advanced → System → “Synchronize”

If the media files are stored in the file format, you can copy the same to the pub/media folder in the Magento 2 store as given below:

cp -r /path/to/m1/media /path/to/m2/pub

Now you can use the following commands for reindexing and recompiling the media in the Magento 2 store.

php bin/magento indexer:reindex php bin/magento deploy:mode:set production

Related Article: Open Source eCommerce Platforms that Will Rule in 2022

Step #8: Post-Migration Testing and Optimization

After completing the migration process, it’s essential to conduct thorough testing to ensure everything is working correctly. You need to check the features, compatibility, security, and third-party integrations to ensure they work adequately and as intended.

In addition to this, you also need to optimize your website for better performance using CDN, SEO strategies, content management techniques, etc.

Conclusion

Migrating your store from Magento 1 to Magento 2 is a complex process that requires careful planning and execution. While this could be done yourself, seeking help from an expert Magento migration agency is the best action.

If you are looking for such an agency, AddWeb Solution is the best. We have worked on several Magento 2 migration projects and know how to carry out the project professionally. We have a dedicated team with many professionals with expertise in migrating to Magento 2.

We can help you carry out Magento 2 migration without any trouble, and we can do it fast. Speak to our client support team to learn how we can help you with your Magento 2 migration process.

Floating Icon 1Floating Icon 2