Migration from Magento 1 to Magento 2: Handling Performance Issues

Written by kateparish | Published 2021/08/22
Tech Story Tags: magento-migration | magento-development | magento1tomagento2 | magento2 | magento-upgrade | coding-skills | tutorial | magento-optimization

TLDR Magento 2 was released in 2015, but official support for Magento 1 lasted until mid-2020. There are some misconceptions about the complexity of switching and possible performance issues in M2. You should know how to migrate in the right way, how to optimize your Magento site’s speed, and how to tackle common challenges that occur after launching a Magentent 2 store. Magentento 2 is more focused on performance and scalability than Magento 1, which means it's more suitable for higher loads, featuring better indexing and support of popular caching solutions.via the TL;DR App

Magento 2 was released in 2015, but official support for Magento 1 lasted until mid-2020. Although many eCommerce websites still run on the older version, the need to move to the newest became acute.

There are some misconceptions about the complexity of switching and possible performance issues in M2. These fears hinder business owners from upgrading their stores. You should know how to migrate in the right way, how to optimize your Magento site’s speed, and how to tackle common challenges that occur after launching a Magento 2 store. In this article, we’ll concentrate exactly on the latter.

Magento 1 vs. 2 Key Distinctions

Magento 2 is a platform that was a direct descendant of Magento 1. The development team behind Magento 2 made the decision to build the next version based on the same functionality, only with more advanced design features, scalable architecture, and modern technologies.

Magento 2 is more focused on performance and scalability than Magento 1, which means it’s more suitable for higher loads, featuring better indexing, built-in support of popular caching solutions, various improvements in database and code functionality, faster checkout, and an emphasis on the mobile experience.

Magento 1 vs. 2 Resource Requirements

In addition to bug fixes, integrations with other systems are often pushed to the after-launch period. This is the time when you need to link Magento 2 with different CRMs, ERPs, and internal corporate software that aren’t considered vital for the initial store launch.

One of the obstacles of migration is the spike in resource needs. Magento 2 can be several times hungrier for your server resources than M1. While your real system requirements will heavily depend on your usage pattern, we can at least shape your expectations a bit.

Take a look at the specs. PHP M1 – 512 MB. PHP M2 – 2 GB. An x4 growth!

It doesn’t have to be this big, of course. But depending on the functionality (installed extensions and customizations, traffic and store layout, the number of SKUs, and product structure), expect the load to rise by at least 30-40%.

So a store that used to work on several servers could migrate to a 3-server setup, where for Magento 1, you could do just fine with a simpler hardware solution.

Magento 1 vs. 2 System Requirements

Magento 1 starts to show its age. It was first released in 2007, which means it’s already 14 years old. The Magento development team does not provide M1 with quality and security updates anymore.

One of the distinct differences that shape Magento 1 vs. 2 performance is system requirements. These are important because technology defines the breadth of solutions and what you can do to your store.

To better understand the widening gap between M1 and M2, take a look at the table:

Technology

Magento 1.9.x

Magento 2.4.x

Web Server

Apache 2.x

Apache 2.4

Nginx 1.7.x

Nginx 1.8

PHP Version

5.4, 5.5, and 5.6, later versions patched to PHP 7

7.3, 7.4, 8.1

Database

MySQL 5.6 (Oracle or Percona)

MySQL 5.7, 8.0
MariaDB 10.2, 10.3, 10.4

Cache Management

Redis Memcached

Varnish 6.x, 6.2, 6.4, 6.5Redis 5.0, 6.0 Memcached

Search

Apache Solr (M1 EE only)

Solr 4.x (native support ended with M2.1) Elasticsearch 7.6, 7.7, 7.9, 7.10

From the get-go, you can notice a few brand-new technologies that Magento 1 doesn’t have. The most important here is Varnish.

Don’t get us wrong. Varnish is still available for Magento 1, but it’s only supported through a third-party module. On the contrary, Magento 2 supports Varnish natively from the standard configuration menu.

Magento 2 is better optimized to use Varnish as a caching solution. Tight integration with Magento 2 offers developers a simpler approach to turning Varnish on. Using Varnish for Magento 1 is more cumbersome and involves a more convoluted installation process.

Improperly installed Varnish introduces new stability risks to the system, which means Magento 2 is a winner here since M2 installation is way easier.

1. Add Varnish to Magento 2 to Improve Response Time

In stark contrast to Magento 1, Varnish’s installation for Magento 2 is relatively easy. Varnish as a solution is well integrated into Magento 2 and even gets a recommendation from the Magento development team.

We also advise that you use Varnish instead of Magento’s full-page cache that’s set as the default solution.

Compared to the Magento 1 Varnish setup, all you need to do is make sure Varnish is installed on your server, then go to your Magento Admin panel and switch to Varnish cache.

Even though Varnish for Magento 2 is way easier to set up, you still need to be careful:

  • Take into consideration cacheable=false blocks which will hurt your web store if configured incorrectly.

  • Make sure content with undefined TTL is taken care of as well.

You can turn Varnish on at Stores > Configuration > Advanced > System > Full Page Cache.

2. Solve Perceived Performance Slowdown in Magento 2

M2 performs better than M1 because of access to Varnish, Redis, and even the default full-page cache.

But despite all this, some long-time Magento users still complain that Magento 2 feels sluggish compared to Magento 1. While this is not actually true, it shows why perceived performance is important for user experience.

Depending on the configuration, a Magento 2 site can be 2-3 times faster than a similar Magento 1 store.

The issue is in the fact that Magento 2 loves its frontend dynamic AJAX code. And AJAX will display spinning wheels anywhere on the page where the content is not yet ready for display. This constant spinning can give users the impression that the site has slowed to a crawl when in fact, it’s ready for interaction.

A quick workaround would be to change how Magento 2 shows your customers what it’s doing. Instead of using an out-of-the-box busy wheel for every operation, Magento 2 can just pop in new content into the page once it’s ready.

A good addition to this content load approach could be the introduction of a lazy loading pattern. Lazy Loading uses placeholders or blurred pictures instead of real images to improve user experience. It can be implemented using a lazy loading extension.

3. Install Elasticsearch to Boost Search Performance

Elasticsearch is an extremely useful search acceleration tool that has only grown in popularity since the M1 release. For Magento 2, you no longer need to purchase a separate extension.

Magento 2 supports Elasticsearch natively, while for Magento 1, you’ll have to buy a third-party extension to use it.

Native support has three main advantages:

  • Native Elasticsearch is obviously free, which is nice

  • Native support means Elasticsearch will update with Magento; no need to worry that something breaks along the way

  • You enjoy enhanced stability with fewer compatibility issues with core Magento

All you need to do is install Elasticsearch, then go to Stores > Configuration > Catalog > Catalog > Catalog Search and turn it on.

Elasticsearch is an integral part of Magento 2. Learn how you can install and configure it on the official Magento 2 portal.

4. Choose Reliable Third-party Modules to Avoid Security Issues

By default, Magento 2 offers an optimal security level. Therefore, there are no additional configurations needed to protect your M2 store. However, the threat might come from numerous third-party modules, either ready-made or custom. The root of possible problems is an unoptimized code.

In this case, there are two main recommendations: purchase Magento 2 extensions on trusted marketplaces like the official Magento one. The second way is to order custom modules from certified Magento experts.

5. Draw Attention to SEO Recovery

Moving to Magento 2 inevitably leads to substantial losses in terms of SEO. Your store’s ranking in Google will deteriorate anyway because of rebuilding and changing URLs. Besides this, keep an eye on duplicate content as well as localization and multi-store-related SEO issues.

To Conclude

As we see, pitfalls that you may face after switching to Magento 2 are not so dramatic that you refuse to move to Magento 2. After all, the instant and distant advantages of the up-to-date CMS outweigh discomfort and problems during the migration process.


Written by kateparish |
Published by HackerNoon on 2021/08/22