How to Upgrade Magento 2 to the Latest Version

MagentoMagentocommerce
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

Leave a Reply

Your email address will not be published. Required fields are marked *

8 − two =

2hats Logic HelpBot