Upgrade your Adobe Magento Open Source application from the command line

Shailesh Bhagliya
1 min readSep 16, 2022

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

bin/magento maintenance: enable

Create a backup of the composer.json file.

cp composer.json composer.json.bak

update composer Json

composer require-commerce magento/product-community-edition 2.4.0 --no-update orphp -d memory_limit=-1 /opt/cpanel/composer/bin/composer update --ignore-platform-reqs (For cpanel)ea-php81 -d allow_url_fopen=on  -d memory_limit=-1 /opt/cpanel/composer/bin/composer require-commerce magento/product-community-edition 2.4.5 --no-updateea-php81 -d allow_url_fopen=on  -d memory_limit=-1 /opt/cpanel/composer/bin/composer update --ignore-platform-reqs

rm -rf var/cache/*

rm -rf var/page_cache/*

rm -rf generated/code/*

php -d memory_limit=-1 bin/magento s:up

php -d memory_limit=-1 bin/magento s:d:c

php -d memory_limit=-1 bin/magento s:s:d -f en_US

php -d memory_limit=-1 bin/magento cache:clean

php -d memory_limit=-1 bin/magento cache:flush

Sometimes Giving 500 error on browser after update

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chmod u+x bin/magento

--

--