Update-magento2

You can upgrade your Magento application from the command line if you installed the software by:

    • Downloading the metapackage using
Copy to Clipboard
  • Installing the compressed archive.

Do not use this method to upgrade if you cloned the Magento 2 GitHub repository.

The following instructions show you how to upgrade Magento using Composer.

  • Magento 2.4.2 introduced support for Composer 2.
  • If you are attempting to upgrade from Magento <2.4.1(“below 2.4.1” for example 2.4.0, 2.3.9, …), you must first upgrade to a version of Magento that is compatible with Composer 2 (for example, 2.4.2) using Composer 1 before upgrading to Composer 2 for Magento >2.4.2 (above 2.4.2 version) upgrades.

Prerequisites to prepare environment before starting the upgrade process:

  • Check PHP and environment settings—Verify that PHP and other environment settings are compatible with the system requirements.
  • Switch to maintenance mode—To prevent access to your store while it’s being upgraded, switch your store to maintenance mode:
Copy to Clipboard
  • Install the Composer update plugin—The magento/composer-root-update-plugin Composer plugin resolves changes that need to be made to the root project composer.json file before updating to a new Magento product requirement.The plugin partially automates the manual upgrade by identifying and helping you resolve dependency conflicts instead of requiring you to identify and fix them manually.
Copy to Clipboard
  • Update the dependencies:
Copy to Clipboard

Begin Update of Magento 2.

  1. Backup the composer.json file.
    Copy to Clipboard
  2. Indicate the Magento community edition packages and the version (2.4.0) that you want to upgrade to.

    Magento Open Source:

    Copy to Clipboard

To see the full list of available 2.4 versions:

  • Magento Open Source:
Copy to Clipboard
  • Example – Minor release:
  • Minor releases contain new features, quality fixes, and security fixes. Use Composer to specify a minor release. For example, to specify the Adobe Commerce 2.3.7 metapackage:
Copy to Clipboard
  • Example – Security Patch
  • Security patches contain security fixes only. They are designed to make the upgrade process faster and easier.
    Use Composer to specify a patch.
    For example, to download the Magento Open Source 2.3.6-p1 metapackage:
Copy to Clipboard

Apply updates.

Copy to Clipboard

Clear the var/ and generated/ subdirectories:

Copy to Clipboard

Then Update the Database and Schema:

Copy to Clipboard
  • After, Setup Upgrade  do di:compile this command is use for compile all necessary files and generate files .
Copy to Clipboard
  • Then after do content deploy command for deploy contetnt to magento
Copy to Clipboard

Disable maintenance mode:

Copy to Clipboard

About Author:

Mukul Soni

Mukul_author