In COVID-19 pandemic, consumer behaviour has changed significantly. Consumers tend to purchase online instead of buying products in person. As a result, the eCommerce market is growing rapidly than ever, which leads to the necessity of enhancing customer experience to meet the rising demand. To help merchants capture new opportunities in the current commerce landscape, Magento rolls out with the latest release of Magento 2.4.0, which is officially released on July 28th, 2020.

The main changes in this latest version of Magento Open Source include a wide range of new features, improvements, component updates, and great product stability.

In this article, we will explore the updates and upgrades of Magento 2.4 Open Source and I will bring you a detailed instruction to upgrade Magento 2.4 in two ways.

The first one is following the Magento instruction and the other one is by using LitExtension’s automated migration tool. After that, you can choose the right one for your business by comparing these two methods.

Latest features on Magento 2.4 Open Source

1. Security

Considerable security changes have been made in Magento 2.4. This release includes over 30 security fixes and platform security improvements, while Magento 2.3.5 only offers more than 25. These security enhancements prevent Remote Code Execution (RCE) and cross-site scripting (XSS) vulnerabilities.

Firstly, Magento 2.4 implements two-factor authentication for Admin accounts, Magento.com user accounts, and Cloud SSH access. Take the Magento Admin account as an example, two-factor authentication (2FA) is now required for the Magento Admin. Therefore, Admin users must first configure their 2FA before logging into the Admin through either the UI or a web API. This extra step of authentication makes it harder for malicious users to log in to the Admin without authorization.

Secondly, the template filter strict mode is now enabled by default. Magento components (including CMS pages and blocks) that use the template filter in legacy mode can be vulnerable to Remote Code Execution (RCE). Enabling strict mode by default ensures that RCE attacks cannot be deliberately enabled.

Thirdly, data rendering for UI data providers is now disabled by default. This removes any opportunities for malicious users to execute arbitrary JavaScript.

Lastly, this version supports a new security.txt file. This file is an industry-standard file on the server that helps security researchers report potential security issues to site administrators.

2. Infrastructure

This release includes improvements to core quality, which enhances the quality of the Framework and these modules: Customer Account, Catalog, CMS, Import, Cart and Checkout, and B2B.

Firstly, unlike Magento 2.3.5, the new version includes a new default search engine called ElasticSearch. It supports the use of partial words in search terms for product names and SKUs when using quick search.

Moreover, Magento has changed from the PayPal Express Checkout integration to the latest PayPal JavaScript SDK which automatically collects and passes needed risk parameters to PayPal.

Last but not least, this release adds a new function called Seller-assisted shopping. This feature allows merchants to view the storefront on behalf of their customers.

3. Platform

The platform upgrades enhance website security and performance significantly thanks to the supported versions of PHP and PHPUnit, ElasticSearch, MySQL, and other dependencies. Specifically, it supports PHP 7.4 instead of PHP 7.1 and 7.2, PHPUnit 9.x instead of PHPUnit 6.5.

Also, ElasticSearch 7.6.x is now the default catalog search engine for Magento Open Source. ElasticSearch version 2.x code has been removed. ElasticSearch versions 5.x and 6.x have been deprecated and are no longer supported. The advent of MySQL 8.0 also vastly improves Magento’s performance, security, and reliability.

Furthermore, the MySQL search engine has been removed from Magento 2.4.0 and replaced with the default search engine ElasticSearch. ElasticSearch provides superior search capabilities as well as catalog performance optimizations.

Now, Magento 2.4 deploys MariaDB 10.4 which holds the key to performance and reliability improvement compared to MariaDB 10.2  in the previous version.

4. Performance

Apart from infrastructure, a lot of improvements have been made in the performance of Magento 2.4. Now, customer data section invalidation logic is improved. It invalidates all customer data in a new way to avoid local storage error. Previously, private content (local storage) was not correctly populated when you had a custom etc/frontend/sections.xml with action invalidations.

Additionally, the enhancements in Multiple optimizations to Redis performance minimize the number of queries to Redis that are performed on each Magento request.

This release also improves caching of results of SQL queries to inventory tables and got an improvement of up to 25-30% to Quick Order add-to-cart performance.

Lastly, merchants can now use lazy loading to load images. Lazy loading (also called on-demand loading) is an optimization technique for online content. It assists in loading only the required section and delays the remaining instead of loading the entire web page.

5. Data query language

In terms of data query language, Magento 2.4 introduces 3 main innovative changes in Magento 2 GraphQL compared to the previous one. PickupLocations query is added to support the Inventory In-store pickup feature. Next, categories query can filter specific categories. Finally, reorderItems mutation allows a logged-in user to add all the products from a previous order into their cart.

6. Other outstanding improvements

Besides the above features, Magento Open Source 2.4 is highly appreciated by other top-notch functions. Typically, it is capable of licensing stock image previews in Adobe Stock Integration v2.0. It obsesses a New Magento Media Gallery which is up to 30x faster than the previous version.

Moreover, it improves PWA Studio and fixes bugs. They also updated Vendor-developed extensions such as Amazon Pay, Braintree Payments, Klarna, Vertex, and Yotpo.

Adobe integration
Adobe integration

How to upgrade your store to Magento 2.4 Open Source?

It is clear that the latest version of Magento Open Source, Magento 2.4, has substantial improvements. All these things can satisfy both merchants and customers and better their experience. Therefore, upgrading your store to Magento 2.4 Open Source is of significant importance. There exist 2 popular ways for you to migrate:

  • Following Magento instructions
  • Using an automated migration tool.

Let’s find out more about these 2 methods.

1. Use automated migration tool

LitExtension is a well-known shopping cart migration service, which has more than 150000 completed store migrations, over 50000 customers all over the world with 98% customer satisfaction. Our tool helps you migrate your store accurately and smoothly in literally a few hours. Moreover, your store will not be interrupted during the migration because it is still active and receives new orders and customers. Only 4 steps to go to migrate your store by using LitExtension’s automated migration tool as follows:

Step 1: Preparation before upgrading.

You could backup your Magento 2 via Admin Panel if you want and create your new Magento store version 2.4.0. Note that LitExtension would not distort your data in anyways.

You can find a complete guide to back up your Magento store here.

Step 2: Perform migration.

Firstly, sign up/ log in your LitExtension account.

Sign up in LitExtension account
Register an account or Sign in on LitExtension site

Secondly, fill in the carts’ information.

After registering, hit the button ” Create New Migration” at the top right on the screen. Then, choose Magento as your source cart, fill in its URL in the corresponding field. After that, you have to set up a connector according to the instructions.

Source Cart Setup
Source Cart Setup

Then, repeat the same setting procedure for your target store

Target Cart Setup
Target Cart Setup

Thirdly, select entities you want to migrate and launch full migration.

In this step, you can click Select All or choose specific entities such as Products, Customers, or Coupons to migrate. Besides, LitExtension also provides you Additional Options to extend your data import functionality.

Configuration
Configuration

Fourthly, perform Migration to Magento version 2.4.0

LitExtension offers you the demo migration first to help you get familiar with migration. It  just takes you a few minutes. You can also go straight to full migration by selecting ” Skip the Demo migration”

Full migration
Full migration

Step 3: Check result.

When you complete the migration, select “Check result” to make sure all the entities you choose are migrated.

Check result
Check result

Then, you have to check your data in both backend and frontend to ensure that all of the data is migrated correctly.

To show the data on the frontend, you need to run the command line to resize images, reindex, and clear cache as follows:

bin/magento catalog: images: resize
php bin/magento cache: clean
php bin/magento cache: flush
php bin/magento indexer: reindex

However, Out of stock products are disabled on Magento stores by default. Therefore, to display these products, you need to follow these steps:

Go to System > Configuration > Catalog > Inventory > Stock options > Choose ” Yes” in Display Out of Stock Products and click ” Save config”

Step 4: Set up your new Magento store.

In the final step, there are some post-migration activities to put your store into operation as follows:

  • Setup theme for your new store
  • Install necessary extensions
  • Development ( if any )
  • Run recent data migration
  • Run command line again to show new data on the front end
  • Change DNS and switch domain

Please read this article to get detailed instructions.

2. Follow Magento instructions

Firstly, you also have to back up your data before the migration in case something may go wrong. This step avoids important data loss such as products, customers, orders,… It is extremely important when you migrate manually. You can follow the aforesaid instructions in the previous part.

Note: You must install and configure Elasticsearch 7.6.x before upgrading to Magento Commerce or Magento Open Source 2.4.0

You can upgrade your Magento application from the command line if you installed the software by:

  • Downloading the metapackage using composer create-project.
  • Installing the compressed archive.

Step 1: Before you begin

Complete the following prerequisites to prepare your environment before starting the upgrade process:

  • Determine whether your current catalog search engine is supported.
  • Complete the Update and upgrade checklist.
  • Set the pub/ directory root.
  • Check PHP and environment settings.
  • Switch to maintenance mode. To prevent access to your store while it’s being upgraded, switch your store to maintenance mode:
$ bin/magento maintenance:enable
  • Check the status of cron jobs. To prevent various unexpected problems during the upgrade, wait for all active running Magento cron jobs to finish or stop them.
  • Install the Composer update plugin. The magento/composer-root-update-plugin Composer plugin resolves changes that need to be made to the root project composer.json file before updating to a new Magento product requirement.

To install the plugin:

$ composer require magento/composer-root-update-plugin=~1.0 --no-update

Update the dependencies:

$ composer update

Step 2: Manage packages

Backup the composer.json file.

$ cp composer.json composer.json.bak

Add or remove specific packages based on your needs. For example, if you are upgrading from Magento Open Source to Magento Commerce, remove the Magento Open Source package.

$ composer remove magento/product-community-edition --no-update

Indicate the Magento packages, both editions (community or enterprise) and the version (2.4.0), that you want to upgrade to.

Magento Open Source:

$ composer require magento/product-community-edition=2.4.0 --no-update

Step 3: Update metadata

  1. Update the “name”, “version”, and “description” fields in the composer.json file as needed.
  2. Apply updates.
$ composer update

3. Clean the Magento cache.

$ bin/magento cache:clean

Step 4: Clean up

Manually clear caches and generated content.

  1. Clear the var/ and generated/ subdirectories:
$ rm -rf var/cache/*

$ rm -rf var/page_cache/*

$ rm -rf generated/code/* Update the database schema and data.

$ bin/magento setup:upgrade

2. Disable maintenance mode.

$ bin/magento maintenance:disable

3. (Optional) Restart Varnish. If you use Varnish for page caching, restart it:

$ service varnish restart

Step 5: Check your work

Open your storefront URL in a web browser to check whether the upgrade was successful. If your upgrade was unsuccessful, your storefront will not load properly.

If the application fails with a We’re sorry, an error has occurred while generating this email. error:

  1. Reset file system ownership and permissions as a user with root privileges.
  2. Clear the following directories:
var/cache/

var/page_cache/

generated/code/

3. Check your storefront in your web browser again

Conclusion

In this current eCommerce landscape, the release of Magento Open Source 2.4.0 is extremely important to meet the demand of merchants. This version has necessary changes that substantially facilitate store operation. That’s why you need to upgrade your Magento store to the latest version.

We know that following the Magento instruction may be difficult and complicated for those who have no technical skills and it takes a lot of time. Therefore, using LitExtension’s automated migration tool will help you upgrade your Magento store rapidly, accurately, and securely with some simple steps.

Let’s try our Free Demo to experience how easy the migration would be. If you find it difficult in any steps, don’t hesitate to contact our support agent at any time.

Author