The Ultimate Guide to Upgrade Magento 2
Today we are going to talk about how to upgrade Magento 2 to the latest version by simply following simple yet ultimate guide.
Why to upgrade to the latest version?
Please see the following reasons for you to upgrade your Magento 2 website to the latest version -:
- To secure your website and your customer’s personal data. Hackers look for websites with older versions because they know the security holes found on those versions.
- You might miss out on new and amazing features
- End of support for the older versions. Magento has already stopped supporting Magento 2.1 in June 2019 and Magento 2.2 in September 2019.
- Magento continues to improve performance efficiency of the pages so if you don’t upgrade your site will not run faster for your customers
- Less number of bugs which will save you and your team a lot time and money. Without upgrade you might resolve issues which have already being solved by Magento 2 development team in the latest version
- Better vendor support, most of the third party vendors prefer to have clients with latest version of Magento 2 code. Because their development teams are working on the latest version. The other downside is that they might take longer to support you if your website is running on older version because of backward compatibility issues
Hope the above list has given you enough excuse to upgrade 🙂
As usual lets crack on with our step by step guide to show you how to upgrade to the latest version? -:
Step 1 – Backup your store
Taking the DB backup would be highly recommended in case you want to roll back to the previous version because your site might fall over because either third party extension(s) or your custom work are not compatible with latest version of Magento 2.
Backup can easily be taken either from Magento 2 admin panel by clicking System -> Tools -> Backups or alternatively your DBA can take backup of your MYSQL db directly by login on to the SSH server.
Step 2 – Turn on maintenance mode -:
It is always best practice to have your site on maintenance mode whenever you are upgrading or updating your website. You can use the following command to keep your site on maintenance mode
php bin/magento maintenance:enable
Step 3 – Upgrade to the latest version -:
You can find the latest version of Magento by clicking on the following link -:
https://github.com/magento/magento2/releases
Using the following two commands, we are upgrading our Magento 2 version to 2.3.3
composer require magento/product-community-edition 2.3.3 --no-update composer update
Step 4 – Update your Magento 2 website with new features, security patches and code fixes-:
Use the following commands to upgrade, recompile and rebuild your website
php bin/magento setup:upgrade && rm -rf generated/* && php bin/magento setup:di:compile && rm -rf pub/static/* && php bin/magento setup:static-content:deploy -f en_GB en_US && php bin/magento cache:enable
Step 5 – Turn off maintenance mode -:
After successful upgrade turn off the maintenance mode so that your customer can see your new shiny latest version of your Magento 2 website using the following command -:
php bin/magento maintenance:disable
To check if you have successfully upgraded to the latest version, you can check our how to find Magento 2 version article?
Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.