5

What is the process of upgrading Magento from Magento 2.4.2 to Magento 2.4.4.

As I have checked 2.4.2 is not working with PHP 8.1 so we can not upgrade PHP version first.

And if we upgrade with the same PHP version PHP 7.4 then Magento 2.4.4 will not work.

So Which process needs to do first like upgrading the PHP version OR upgrade the Magento version.

2
  • 1
    magento 2.4.4 work in php7.4, so Without update you PHP version you can upgrade your magento version.
    – S.P
    Commented Apr 18, 2022 at 12:39
  • @S.P, hi please checkout my post to see if you can share some solution this Magento upgrade issue I'm facing. magento.stackexchange.com/questions/357902/… Commented Jul 18, 2022 at 12:34

6 Answers 6

2

Overwrite in your composer.json file the require-dev object with the following one, then run composer update again.

"require-dev": {
    "allure-framework/allure-phpunit": "~1.5.0",
    "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
    "friendsofphp/php-cs-fixer": "~3.3.0",
    "lusitanian/oauth": "~0.8.10",
    "magento/magento-coding-standard": "*",
    "magento/magento2-functional-testing-framework": "^3.7",
    "pdepend/pdepend": "~2.10.0",
    "phpmd/phpmd": "^2.9.1",
    "phpstan/phpstan": "~1.2.0",
    "phpunit/phpunit": "~9.5.0",
    "sebastian/phpcpd": "^6.0.3",
    "squizlabs/php_codesniffer": "~3.6.0",
    "symfony/finder": "^5.2"
}
0
0

First you need to update the PHP version, and then also update the composer to the latest version. for more info please check the following link:

https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

6
  • After the setup the environment, you can proceed with the Magento 2 upgrade. Commented Apr 18, 2022 at 8:00
  • Thanks for the answer, but when i have updated the php version then all the commands of php are stopped working so next process like set it to maintenance mode those stopped working..
    – Yogesh
    Commented Apr 18, 2022 at 8:28
  • Did you update the composer too? Magento 2.4.4 requires composer version 2.x. I was wokring on the upgrade from 2.3.3 to 2.4.3-p1 and I have to upgrade php, mysql to 8.0, elasticrsearch to 7.14. please go through that link I gave you and update all of the things, then proceed. And you can change the mode in app/etc/config file manually. Commented Apr 18, 2022 at 8:41
  • what process I have done like, upgraded Magento using composer and then upgraded PHP version too but now when I'm going to fire the commands like upgrade and compile those are not working and not showing any error too.
    – Yogesh
    Commented Apr 18, 2022 at 9:22
  • Please update the composer too, if it is below 2.x. and then remove the vendor folder, then add the updated composer.json for 2.4.4 and run composer update and then composer dump-autoload Commented Apr 18, 2022 at 9:55
0

Magento Devdoc show php 8 for magento2.4.4, but I tried in my ubuntu with php7.4, it is working.

Magento2.4.4 work in php7.4, you can direct upgrade your magento version.

bin/magento maintenance:enable
composer require magento/product-community-edition=2.4.4 --no-update
composer update

rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf generated/code/*


bin/magento setup:upgrade
bin/magento setup:static-content:deploy -f;
bin/magento maintenance:disable
5
  • Hey S.P thanks for your reply, I have done the same thing and yes it is working with PHP7.4 but as per the documentation of Magento with 2.4.4 it should work with PHP 8.0 or 8.1.. don't you think there is something wrong.. why it is working with 7.4?
    – Yogesh
    Commented Apr 18, 2022 at 12:39
  • Yes, I think so, may be some functionality would not work in php7.4,
    – S.P
    Commented Apr 18, 2022 at 12:47
  • it seems like with the above process it will upgrade only the community and related dependent extension only, it may not install all the things that's why it is working with 7.4.. but not sure
    – Yogesh
    Commented Apr 18, 2022 at 13:01
  • No, I had downloaded it from composer with php7.4, sudo composer create-project --repository=repo.magento.com magento/project-community-edition /var/www/html/latestm2 Still it is working. I was not upgraded i was downloaded from composer
    – S.P
    Commented Apr 18, 2022 at 13:06
  • i had downloaded not upgraded.
    – S.P
    Commented Apr 18, 2022 at 13:12
0

Try with below process and it will work.

composer require magento/product-community-edition 2.4.4 --no-update

composer update --ignore-platform-reqs

php bin/magento s:up

php bin/magento s:s:d -f

php bin/magento s:d:c

php bin/magento in:rein

php bin/magento c:c

7
  • Hi Yogesh, composer update --ignore-platform-reqs is giving me "couldn't resolve to..." error. Do I need to update my PHP to 8.1? Commented Jul 17, 2022 at 4:51
  • Hi, I get this error message immediately after running composer update - Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires magento/product-community-edition 2.4.4 -> satisfiable by magento/product-community-edition[2.4.4]. - cache/cache 0.4.0 requires league/flysystem ^1.0 -> satisfiable by league/flysystem[1.0.0, ..., 1.1.9]. Commented Jul 19, 2022 at 12:19
  • What should I do? Commented Jul 19, 2022 at 12:19
  • Which composer version you are using?
    – Yogesh
    Commented Jul 19, 2022 at 16:24
  • Composer version 2.3.10 Commented Jul 19, 2022 at 17:46
0

So here is what yo need to do, first you need to set a few prerequisites right

  1. Add the package to your composer.json file.

    composer require magento/composer-root-update-plugin ~2.0 --no-update

  2. Update dependencies

    composer update

From that now you do the actual upgrade :

If you not on linux you could just leave out the sudo.

  1. Switch to maintenance mode to prevent access to your store during the upgrade process.

    sudo php bin/magento maintenance:enable

  2. 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

  1. 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.

  1. Create a backup of the composer.json file.

    cp composer.json composer.json.bak

  2. 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

  1. 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

  1. Apply updates.

    composer update

  2. Clear the var/ and generated/ subdirectories:

    rm -rf var/cache/*

    rm -rf var/page_cache/*

    rm -rf generated/code/*

  3. Update the database schema and data.

    sudo php bin/magento setup:upgrade

  4. Disable maintenance mode.

bin/magento maintenance:disable

Open your storefront URL in a web browser to check whether the upgrade was successful.

1
  • You can upgrade with 7.4 then you can change your /etc/sites-available/magento file on the server unix:/var/run/php/php7.4-fpm.sock; to server unix:/var/run/php/php8.1-fpm.sock; and create a symbolic link to /etc/sites-enabled/magento then you should be good to go
    – Mabonito
    Commented Oct 27, 2022 at 8:52
0

If you want to upgrade the Magento version kindly follow the below steps. First, you need to check the system requirements according to your Magento versions like PHP, elastic search, and MySQL.

1.Take DB backup

  1. After taking a DB backup copy composer.json and composer.lock files and .htacess of the root and pub folder.

    cp composer.json _composer.json.backup

    cp composer.lock _composer.lock.backup

    cp .htaccess .htaccess_bakup

    cp pub/.htaccess pub/.htaccess_bakup

  2. After the files backup disable all the third-party extensions and put the site in maintenance.

    php -d memory_limit=6G bin/magento module:disable module_name

    php -d memory_limit=6G bin/magento main:ena

  3. After enabling the maintenance mode please run the below commands.

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

composer require magento/product-community-edition="2.4.4 version you want to upgrade" --no-update.

composer update

if you are getting error while composer update kindly take a reference of the fresh magento's composer.json and change accordingly in the your project's composer.json

  1. After running the composer update command kindly run Magento's cmd. ## php -dmemory_limit=6G bin/magento se:up ## php -dmemory_limit=6G bin/magento se:di:co ## php -dmemory_limit=6G bin/magento s:s:d -f ## php -dmemory_limit=6G bin/magento c:f ## php bin/magento maintenance:disable

That's it your Magento version is upgraded successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.