1

How do I upgrade Magento 2.4 using composer to e.g. Magento 2.4.1 or Magento 2.4.2 or Magento 2.4.3 for that matter?

We've been reading https://devdocs.magento.com/guides/v2.4/comp-mgr/cli/cli-upgrade.html

But every time we run into problems with missing modules and similar issues. Also the guide is a 'catch all situations guide' like moving from community ot enterprise and v.v. --

We just want to move from 2.4 to 2.4.1

Would this be the following, clear concise or can it be better?

bin/magento maintenance:enable
composer require magento/product-community-edition=2.3.3-p1 --no-update
composer update
rm -rf var/cache/* var/page_cache/* generated/code/*
bin/magento setup:upgrade
bin/magento maintenance:disable
service varnish restart #(optional, often can only be done by root)

3 Answers 3

2

Sequence to run for a minor update from Magento 2.4 using composer to e.g. Magento 2.4.1 or Magento 2.4.2 or Magento 2.4.3

bin/magento maintenance:enable
composer require magento/product-community-edition=2.4.3-p1 --no-update
composer update
rm -rf var/cache/* var/page_cache/* generated/code/*
bin/magento setup:upgrade
bin/magento maintenance:disable

(optional, these often can only be done by root)

service php-fpm restart
service nginx restart
service varnish restart
0

Follow the Below Commands,

composer require magento/product-community-edition=2.4.0

composer update

bin/magento s:up

bin/magento s:s:d -f

bin/magento c:f
0

I upgraded today from 2.4.2-p1 to 2.4.3.

Here is what I did:

1.

composer remove magento/product-community-edition --no-update
composer require magento/product-community-edition 2.4.3 --no-update
  1. Then removed the replace section of my composer.json

If you don't do this, it might brick your install. I had to roll back my setup from a backup because it completely destroyed it.

  1. Update this section to the one you are updating to:

    'version': '2.4.3

This was throwing composer errors if I didn't change it.

  1. Then just

    composer update

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

    bin/magento setup:upgrade

    bin/magento setup:di:compile

    bin/magento setup:static-content:deploy

    bin/magento cache:flush

Your Answer

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

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