magento clutch
magento clutch
magento clutch

How to Update Magento 2 to Latest Version: Complete Guide

Jun 11, 2021 0
Update Magento 2 to Latest Version

Any successful software product is supported by developers with various updates and improvements. The e-commerce Magento platform is no exception, and Adobe regularly releases both small fixes and major updates that bring new functionality, improve performance and overall user experience. However, the Magento update process is far from simple pressing a button. In this article, we will go through the three main ways of how to update Magento 2 version and tell you about important preparations before the update. Without further ado, let’s get started.

Preparation Stage

No update is complete without a preparatory phase. You should take a close look at the future update, prepare yourself and prepare your store. Without this step, the entire update process runs the risk of failure. Now, let’s go through the most basic preparation steps.

Step #1. Backup

This is one of the first and, at the same time, the most important stages. You must make a complete backup of your store before you update Magento to latest version. A backup will help you restore your store to its original state in case one of the upgrade steps goes wrong and leads to website breakdown or data loss. The backup should include the store and database files. In order to make a backup, you can use your server’s control panel or SSH. If you are not quite tech-savvy, contact your hosting provider and ask for a backup of the entire store.

Step #2. Disable Cache

Before starting the update process, you should disable the cache, which will significantly save you time since you will see all the changes immediately, without the need to clear the cache after the update. In order to disable the cache, you should do the following actions:

  1. Go to the Admin panel
  2. In the Administrator panel, go to the System tab
  3. In this tab, you will see Manage cache. Click on it
  4. Next, select all types of caches and disable them

After updating, do the same manipulations in order to bring the cache back.

Update Magento 2 to Latest Version

Step #3. Go Through Preparation Checklist

The next steps are pretty minor but just as important. So we decided to combine them into one checklist, which we recommend you to follow before you update Magento to latest version.

  • Check out all available Magento versions and choose the freshest and most secure to update your platform.
  • When you select an update version, carefully read all the changes that this update contains. This is important in order to avoid questions after the update like “What is this feature? What has changed here?”
  • We advise you to have a test version of the website for each update to run the update and check the compatibility of your server. No one is immune from possible changes in the server configuration in order for the update to work correctly, and it is better to do it in a test environment.
  • Save all logs and reports that will be displayed during the update. This will help you navigate in case something goes wrong. It will be much easier for you to understand at what point the update did not go according to plan.
  • Once you are sure that the update works fine in a test environment, set the date and time for the update on the live server. We advise you to choose the date and time when the website traffic is minimal.

So, we have highlighted the process of preparing for the update. Then, it’s time to move on to the main part of our article, namely how to upgrade Magento platform.

Best Way to Upgrade Magento Platform: Installation Wizard, PHP Composer, or Manually?

As we mentioned earlier, there are three ways to update your Magento platform to the latest version: using the Web Setup Wizard, PHP Composer, or manually rewriting the core Magento files. We will analyze in detail each method, as well as some of the nuances associated with them.

Option #1. Installation Wizard

This method is one of the simplest ways to upgrade Magento 2 to latest version. However, there is one caveat that can upset many non-tech entrepreneurs. This option is only available on versions 2.0, 2.1, 2.2, and 2.3. In the versions above, this feature was removed by the developers. However, if your version of Magento matches those named, you can use this method to update the platform to the most recent version. To upgrade, you must follow the following algorithm:

  1. Go to the Admin panel and click on the System button.
  2. You will see a Tools submenu. Next, click on the Web Setup Wizard.
  3. You will find yourself in the Web Setup Wizard section, and in the left panel, click the System Upgrade button.
  4. Next, you need to confirm the correctness of the Private and Public Keys of your Magento Store. If you have forgotten these keys, follow the instructions indicated in the System Upgrade window where you are now. After that, click on the Submit button.
  5. You will find yourself on one of the first update screens. Now you need to select the Magento Core Components version from the dropdown menu. After that, you can choose whether include or disclude individual components from the upgrade process. This setting is optional. Once you have completed all of the above steps, click on the Next button.
  6. On the second screen, you will need to check if your environment meets the requirements of the future Magento update. Just click on the Start Readiness Checks button, and the system will do everything for you. The most common verification problems are incompatibility of some PHP components, different PHP versions between the Magent update and your environment, and conflicting dependencies. If these problems occur, they should be fixed and retested. After completing the environment check, click the Next button.
  7. The next screen is dedicated to creating a backup. If you followed our preparatory steps, you already have a backup of the entire system, and you can skip this step. However, if you still haven’t made a backup for some reason, this section will help you create it quickly. Just check the component boxes that require backup and click the Create Backup button. Then the system will copy all the data, and you just need to wait a little while. When the backup is complete, click Next.
  8. The final screen before the upgrade where you only need to click the Upgrade button. Then the system will automatically start updating the Magento platform. It may take some time, and after a successful update, you will see a Success notification which means that the update was completed without errors.

Next are the post-update steps you should be aware of as well:

  1. If you did not disable cache in Magento settings before updating, you need to do it manually before you update Magento to latest version. To do this, you must use the command line in which you must enter the following command: php bin / magento cache: clean
  2. After the upgrade, you should check the individual elements of your store (extensions, third-party modules, themes, and more). If you notice that some elements are not working correctly or have completely stopped working, you will need to update them manually.

Option #2. PHP Composer

PHP Composer is an indispensable tool for dependency tracking and the establishment of automated Magento updates. Beyond that, no Magento 2 upgrade to latest version can be done without it. Starting from the 2.4 version, this process requires PHP Composer. So, let’s take a look at the process of updating Magento using PHP Composer:

  1. The first thing you need to do is set up an SSH connection to the Magento server.
  2. Next, you must use the command line and access the Magento 2 root directory. It usually looks like this: cd/var/www/html/magento2.4. You can customize the path to your liking, for example, so that it reflects the path on your system.
  3. Next, you need to switch your Magento platform to maintenance mode. To do this, enter this command: php bin / magento maintenance: enable. You will see a green message “Enabled maintenance mode” and after that, you can proceed to the next step. While this mode is in effect, all visitors to your website will be redirected to the standard Service Temporarily Unavailable page.
  4. The next step is optional. You can check the available Magento Open Source 2.4 packages. To check, you need to enter the command: composer show magento / product-community-edition 2.4. * –All | grep -m 1 versions.
  5. Now you need to apply the available updates. Enter the composer update command.
  6. The next step is to check for the update. To do this, you need to authenticate and enter your Private and Public Keys into the command line.
  7. Next, the update process starts, which will take some time. Once the update is complete, you need to clear the cache (if you disabled it beforehand, you can skip this step). To clear the cache, enter this command line: php bin / magento cache: clean.
  8. Next, you need to clean up the directories and subdirectories created for the update and are no longer needed. Enter the following command at the command line: rm -rf var / cache / * var / page_cache / * generated / code / *.
  9. The last step is to update the database schema. To start the upgrade, enter this command in the command line: php bin / magento setup: upgrade. After that, disable the maintenance mode using the php bin / magento maintenance: disable command, and at this point, the update can be considered complete.

"

Option #3. Rewriting Core Files Manually

The third and final update option is great if you decide to run the Magento platform on a local platform and check the system’s performance. This method allows you to manually overwrite old system files, replacing them with new ones. Let’s now look at what steps you need to take to upgrade Magento version using this method.

  1. First of all, you need to download the zip and tar files of the new version of Magento to which you are going to update your platform. These archives are always available on the official Magento website in the Downloads section.
  2. After that, you need to unzip the downloaded zip and tar files to the Magento root directory replacing the old files with the new ones from the archives.
  3. Next, update the schema and database data, update the dependencies, clear the cache, and re-index the indexers using the command line. To do this, enter the following commands that mean the above actions, respectively.

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
php bin/magento indexer:reindex

Magento 2 Upgrade Service in Sam-Ecommerce

If these three options are not suitable for you due to lack of technical knowledge or limited time, you should seek help from technical specialists like us. Sam eCommerce is a team with many years of experience providing various services related to e-commerce in general and Magento in particular. We have more than a hundred projects on our account, ranging from simple updates to custom development of Magento-based stores from scratch. We know this platform like the back of our hands and are ready to provide you with the top-tier service. Our Magento professional support services include the following:

  • Tech enhancements. Every store needs upgrades to keep up with the times and deliver the best customer experience. We always keep our finger on the pulse of Magento innovations and are ready to tell you how to upgrade Magento latest version or develop custom functionality improvements from scratch.
  • UX enhancements. Your store should be modern not only technically but also visually. Our professional designers use only the most modern UI/UX methodologies, providing unique and advanced designs.
  • Troubleshooting. During our many years of experience with Magento, we have seen many errors and problems, and we know how to fix them quickly. Therefore, we will check your store for any problems and fix them all as soon as possible.
  • Security audit. Maximum security is one of the main criteria for a good store. Therefore, we conduct a global store audit, identify security holes and fix them so that your store is protected from hacker attacks.
  • Performance optimization. A drop in performance is unacceptable because every second of delay is a loss in profit. We analyze your website, conduct a full code review and, thanks to this, identify and fix problems that slow down your website.

If you choose Sam eCommerce services, you will receive:

  • Reliable support team. Our motto is “There are no unsolvable problems”. We will answer any question, fix any problem, and all this with an individual approach to each client.
  • Easy communication. We are a fully English-speaking team fluent in all modern communication tools to build seamless communication with clients.
  • Time-zones independent support. We value our clients’ time, so we provide Magento maintenance and support services at any time convenient for the client.

Final Thoughts

Magento 2 upgrade to latest version is a must if you want to keep up with the times and have the latest features in your arsenal to improve your user experience. Plus, keeping your store up to date helps keep your store as secure as possible. In order for the update process to take place quickly and not take up your precious time, you can always turn to a professional team for services. We at SaM-Ecommerce specialize in high-quality Magento services.

Are you on the verge of updating your Magento platform? Drop us a line, and our representative will contact you to provide free consultation on your update.

Business Development Manager at SaM Solutions

    Leave a comment

    * - required fields. Your email will not be published