Hello Magento Folksš,
In this tutorial, I will illustrate How to Upgrade Magento Version from 2.3.X to 2.4.2. Last article I have discussed How to Remove Magento Product Attribute From Magento 2 Backend checkout in case you missed it. Letās start to upgrade 2.4.2:
Contents
As we all know that Magento made a release of Magento 2.4.2 and if you are Magento 2 store owner or Magento developer then you should never miss this update. Check detailed information of Magento 2.4.4 release notes in our previously published article Magento 2.4.4: Release Notes (Everything You Need to Know).Ā
Enhance your Magento 2 store by upgrading it with the latest version of Magento 2.4.2. by our certified and experienced developers. Check out our article on How to Install Magento 2Ā for installing your Magento 2 Store Smoothly.
Firstly we will prepare our site for Upgrade
Assure you have configured your server that works with PHP 7.4. As per the release notes of Magento 2.4.2, it only supports PHP 7.4. You can also install Magento 2.4.2 using PHP 7.3 at your own risk as it is not tested anymore. The best practice is to use the latest version of PHP 7.4.
Check your PHP version with the help of the given below command:
php -v
Assure your composer is pointing to the accurate PHP version. By applying the below-given command you can verify your composerās PHP version
composer -vvv about
Assure you have configured your server that works with Elasticsearch 7.9.x. As per the release notes of Magento 2.4.2, is recommended to use Elasticsearch 7.9.x. You can apply the below-given command to verify your version of Elasticsearch.Ā
Learn from scratch How to Install Magento 2.4 with Elasticsearch In Ubuntu and check the tutorial at Magento 2: How To Configure Elasticsearch.
curl -XGET āhttp://localhost:9200ā
OrĀ
curl -XGET āhttp://YOURDOMAIN:9200ā
Now backup your database as well as code. Most of the developers have the best practice to manage their code in GitHub. So for them, there is no need to take code backup as they will get the code from there itself but the database backup is mandatory for all.Ā
Step 1: Implement the below command to convert your site into maintenance mode if you are performing on a live site.
php bin/magento maintenance:enable
Step 2: In case you are implementing the upgrade of Magento 2.4.2 into your local system then you can ignore the initial step andĀ
Grab backup composer.json using the below-given command.
cp composer.json composer.json.bak
Step 3: Now we will Install the Composer update plugin
composer require magento/composer-root-update-plugin=~1.0 --no-update composer update
Step 4: After this, you will require to update the composer.json with the latest version.
In this scene, we have Magento Version 2.4.2. so you can go to the Magento 2 installation root path and fire the below-given code.
composer require magento/product-community-edition=2.4.2 --no-update
Step 5: Fire the following command
composer update
This process will consume some time to get completed. Mainly this command will download all the required packages and upgrade your Magento version from 2.3.x to 2.4.2.
After you are done with the above steps fire below given commands.
Step 6: Clear cache and regenerate code.
php bin/magento cache:clean rm -rf var/cache/* rm -rf var/page_cache/* rm -rf generated/code/* php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f
Step 7: At last donāt forget to disable maintenance mode
php bin/magento maintenance:disable
Thatās it you are upgraded to Magento 2.4.2
Hopefully, all are able to install Magento 2.4.2 successfully by implementing the above-given steps. For upgrading your Magento 2 store with the latest Magento 2.4.2 version you can use our Magento Upgrade service and let your store get upgraded to Magento 2.4.2 by certified and professional developers.
Dontās forget to drop your comment in the comment section below and also share the tutorial with your Magento friends so they can also get upgraded to the latest Magento 2.4.2 version.Ā
Till Then Stay Safe and Keep Developing
Happy Upgradingš.
In the world of business, understanding financial metrics is crucial for making informed decisions and…
Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…
In this era, businesses are always on the lookout for ways to engage with their…
Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…
E-commerce has transformed the way consumers shop for products and services and interact with businesses.…
The e-commerce world is constantly in flux. New tech and strategies emerge daily to help…
View Comments
After upgraded from 2.3.4 to 2.4.2 my website is not working showing error like below
1) Not Found
The requested URL was not found on this server.
2) Magento supports PHP 7.3.0 or later. Please read Magento System Requirements.
not working
Good article, kudus
This is dangerous, because composer update will failed with many reason.
Magento recommends upgrading the Magento version using composer. Of course, you shouldn't do it on the live website directly.
Thank you. Really helpful.
How many hours do you reckon it would take to perform this upgrade?
There is no specific but its based on the time when commands are finished.
Thanks for great topic. It's useful.
There is a small typo.
"Assure you have configured your server that works with PHP 7.9.x ..."
It should be
"Assure you have configured your server that works with Elasticsearch 7.9.x ..."
Thank you for pointing out the typo mistake.