2Hats . 2 minutes

How to Upgrade Magento 2 to the Latest Version

To upgrade your Magento Open Source application, follow these simple steps:

Please note that Adobe Commerce 2.4.2 now supports Composer 2. If you’re upgrading from a version earlier than 2.4.1, you’ll need to first upgrade to a compatible version with Composer 2 (for example, 2.4.2) using Composer 1 before proceeding to upgrade to Composer 2 for versions higher than 2.4.2. Additionally, make sure that you’re running a supported version of PHP.

To ensure a smooth upgrade process, it is recommended that you switch your store to maintenance mode. This will prevent access to your store while the upgrades are being made.

bin/magento maintenance:enable

Please create a backup copy of the composer.json file.

cp composer.json composer.json.bak

Add or remove specific packages based on your needs. For example, if you are upgrading from Magento Open Source to Adobe Commerce, remove the Magento Open Source package.

composer remove magento/product-community-edition –no-update

Upgrade your instance by using the following composer require-commerce command syntax:

composer require-commerce magento/<product> <version> –no-update [–interactive-root-conflicts] [–force-root-updates] [–help]

eg: composer require-commerce magento/product-community-edition 2.4.5 –no-update

Command options include:

  • <product> —(Required) The package to upgrade. this value must be either product-community-edition or product-enterprise-edition.
  • <version> —(Required) The version of Magento Open Source that you are upgrading to. For example, 2.4.3.
  • –no-update —(Required) Disables automatic dependency updates.
  • –interactive-root-conflicts —(Optional) Lets you view and update out-of-date values from previous versions, or custom values that don’t match your new version.
  • –force-root-updates —(Optional) Replaces all conflicting custom values with Commerce values.
  • –help —(Optional) Describes the plugin’s usage.

Update the dependencies.

composer update

blog
Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.
Aneesh ceo
Aneesh Sreedharan
Founder & CEO, 2Hats Logic Solutions
Subscribe to our Newsletter
Aneesh ceo

    Stay In The Loop!

    Subscribe to our newsletter and learn about the latest digital trends.