If you are going through a challenge to upgrade Magento 2 or how to update Magento 2 then this article may help you. Let’s get started with the basic steps prior to the update of Magento 2.
Steps on how to update Magento 2
In the first step, Create a backup of the store and enable the maintenance mode.
Once your store is ready to upgrade, you can run the Magento upgrade commands. So, we will upgrade the store to the latest Magento version, i.e., Magento 2.4.6. Run the following commands:
If you are using a particular version to update for Magento then use the below command-
composer require magento/product-community-edition 2.4.6 --no-update
Choose one of the following
composer commands based on the PHP version, and run the command to upgrade your instance.
For PHP 7.3 or higher:
composer require-commerce magento/ --no-update [--interactive-root-conflicts] [--force-root-updates] [--help]
For PHP 7.2 or lower:
composer require magento/ --no-update [--interactive-magento-conflicts] [--use-default-magento-values] [--help]
Now if the version is changed in the composer.json file for your Magento setup then run the below command.
composer update --ignore-platform-reqs
After the above command is successfully completed then run the below commands.
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:clean
php bin/magento cache:flush
Check the Magento 2 version using a CLI command to ensure the upgrade is successful:
php bin/magento --version
Now check and go through the whole Magento site if there are no errors related to the new updated PHP version or Magento degradation. If there is any issue then first go through the all modules in the app/code directory.
For more information to upgrade Magento 2.3 to 2.4 go through the official Magento site – https://experienceleague.adobe.com/docs/commerce-operations/upgrade-guide/implementation/perform-upgrade.html
Hope now you have done with the challenge of how to upgrade Magento 2.3 to the 2.4 version installed. Share if you find this article helpful. Happy coding!!!.