So here is what yo need to do, first you need to set a few prerequisites right
Add the package to your composer.json
file.
composer require magento/composer-root-update-plugin ~2.0 --no-update
Update dependencies
composer update
From that now you do the actual upgrade :
If you not on linux you could just leave out the sudo.
Switch to maintenance mode to prevent access to your store during the upgrade process.
sudo php bin/magento maintenance:enable
Starting the upgrade process while asynchronous processes, such as message queue consumers, are running may cause data corruption. To prevent data corruption, disable all cron jobs.
Adobe Commerce on cloud infrastructure:
./vendor/bin/ece-tools cron:disable
Magento Open Source:
sudo php bin/magento cron:remove
Start all message queue consumers manually to ensure all messages are consumed.
bin/magento cron:run --group=consumers
Wait for the cron job to complete.
Create a backup 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
You can also upgrade sample data.
Adobe Commerce:
composer require magento/module-bundle-sample-data:100.4.* magento/module-widget-sample-data:100.4.* magento/module-theme-sample-data:100.4.* magento/module-catalog-sample-data:100.4.* magento/module-customer-sample-data:100.4.* magento/module-cms-sample-data:100.4.* magento/module-catalog-rule-sample-data:100.4.* magento/module-sales-rule-sample-data:100.4.* magento/module-review-sample-data:100.4.* magento/module-tax-sample-data:100.4.* magento/module-sales-sample-data:100.4.* magento/module-grouped-product-sample-data:100.4.* magento/module-downloadable-sample-data:100.4.* magento/module-msrp-sample-data:100.4.* magento/module-configurable-sample-data:100.4.* magento/module-product-links-sample-data:100.4.* magento/module-wishlist-sample-data:100.4.* magento/module-swatches-sample-data:100.4.* magento/sample-data-media:100.4.* magento/module-offline-shipping-sample-data:100.4.* magento/module-gift-card-sample-data:100.4.* magento/module-customer-balance-sample-data:100.4.* magento/module-target-rule-sample-data:100.4.* magento/module-gift-registry-sample-data:100.4.* magento/module-multiple-wishlist-sample-data:100.4.* --no-update
Magento Open Source:
composer require magento/module-bundle-sample-data:100.4.* magento/module-widget-sample-data:100.4.* magento/module-theme-sample-data:100.4.* magento/module-catalog-sample-data:100.4.* magento/module-customer-sample-data:100.4.* magento/module-cms-sample-data:100.4.* magento/module-catalog-rule-sample-data:100.4.* magento/module-sales-rule-sample-data:100.4.* magento/module-review-sample-data:100.4.* magento/module-tax-sample-data:100.4.* magento/module-sales-sample-data:100.4.* magento/module-grouped-product-sample-data:100.4.* magento/module-downloadable-sample-data:100.4.* magento/module-msrp-sample-data:100.4.* magento/module-configurable-sample-data:100.4.* magento/module-product-links-sample-data:100.4.* magento/module-wishlist-sample-data:100.4.* magento/module-swatches-sample-data:100.4.* magento/sample-data-media:100.4.* magento/module-offline-shipping-sample-data:100.4.* --no-update
Upgrade your instance using the following composer require-commerce command syntax:
composer require-commerce magento/<product> <version> --no-update [--interactive-root-conflicts] [--force-root-updates] [--help]
Example - Minor release
Magento Open Source:
composer require-commerce magento/product-community-edition 2.4.0 --no-update
Adobe Commerce:
composer require-commerce magento/product-enterprise-edition 2.4.0 --no-update
Example - Quality patch
Quality patches primarily contain functional and security fixes. However, they can sometimes contain new, backward-compatible features. Use Composer to download a quality patch. For example, to specify the Magento Open Source 2.4.1 metapackage:
Magento Open Source:
composer require-commerce magento/product-community-edition 2.4.3 --no-update
Adobe Commerce:
composer require-commerce magento/product-enterprise-edition 2.4.3 --no-update
Example - Security patch
Security patches contain security fixes only. They are designed to make the upgrade process faster and easier.
Security patches use the Composer naming convention 2.4.x-px. Use Composer to specify a patch.
Magento Open Source:
composer require-commerce magento/product-community-edition 2.4.3-p1 --no-update
Adobe Commerce:
composer require-commerce magento/product-enterprise-edition 2.4.3-p1 --no-update
Apply updates.
composer update
Clear the var/
and generated/
subdirectories:
rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf generated/code/*
Update the database schema and data.
sudo php bin/magento setup:upgrade
Disable maintenance mode.
bin/magento maintenance:disable
Open your storefront URL in a web browser to check whether the upgrade was successful.