How to Upgrade Magento 2.4.4 to 2.4.7-p4

MAGENTO

3/15/20251 min read

For the latest Magento version(2.4.7-p4), we need PHP 8.2, while the current store(2.4.4) is running on PHP 7.4.

Step 1: Install the Composer Root Update Plugin

Run the following commands to update dependencies before upgrading Magento:

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

Step 2: Upgrade PHP Version

Once the above commands execute successfully, switch the PHP version to 8.2 and run:

composer require magento/product-community-edition 2.4.7-p4 --no-update
composer update

Step 3: Resolving Dependency Issues

You may encounter issues related to the following dependencies:

  • friendsofphp/php-cs-fixer

  • phpstan/phpstan

  • sebastian/phpcpd

  • phpmd/phpmd

  • pdepend/pdepend

To resolve these errors, update the composer.json file by modifying the following entries:

"phpstan/phpstan": ">=0.12.3 <=0.12.23", → "phpstan/phpstan": "^1.9",
"sebastian/phpcpd": "~5.0.0", → "sebastian/phpcpd": "^6.0",
"phpmd/phpmd": "^2.8.0", → "phpmd/phpmd": "^2.12.0",
"pdepend/pdepend": "~2.7.1", → "pdepend/pdepend": "^2.10"

After making these changes, run:

composer update

Step 4: Final Magento Setup Commands

Once the composer update completes successfully, execute the following Magento setup commands:

bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush

This completes the Magento upgrade process! 🚀