How to upgrade Magento 2.3.x to Magento 2.4.6

January 1, 2024
How to upgrade Magento 2.3.x to Magento 2.4.6

How to Upgrade Magento 2.3.x to 2.4.6

Prerequisites:

  • Access to the server where your Magento installation is hosted
  • SSH access to the server
  • A backup of your Magento 2.3.x installation
  • Composer installed on your server

Step 1: Backup Your Magento Installation

Create a backup of your Magento 2.3.x installation including the database, files, and media. This backup will be essential in case anything goes wrong during the upgrade process.

Step 2: Update Composer

Make sure you have the latest version of Composer installed on your server. You can run the following command to update Composer:

composer self-update

Step 3: Update Composer.json File

Open the root directory of your Magento installation and locate the composer.json file. Update the "require" section to specify the new Magento version:

"require": {
    "magento/product-community-edition": "2.4.6",
    ...
}

Step 4: Update Dependencies

Run the following command to update the dependencies:

composer update

Step 5: Clear Cache

Clear the Magento cache by running the following command:

php bin/magento cache:clean

Step 6: Upgrade Database Schema

Run the following command to upgrade the database schema:

php bin/magento setup:upgrade

Step 7: Compile Code

Compile the code by running the following command:

php bin/magento setup:di:compile

Step 8: Deploy Static Content

Deploy the static content by running the following command:

php bin/magento setup:static-content:deploy

Step 9: Reindex Data

Reindex the data by running the following command:

php bin/magento indexer:reindex

Step 10: Test Your Store

After completing the upgrade process, thoroughly test your Magento store to ensure everything is working as expected.

Conclusion

By following these steps, you should be able to successfully upgrade your Magento 2.3.x installation to version 2.4.6. Remember to always perform the upgrade process on a backup of your store to minimize any potential risks.