Skip to content

Magento 2 Upgrade Recommendations

Upgrading Magento 2 is at your own Risk. Upgrade support is outside of our scope; however, we can help you with a restore if something goes wrong.

Before Upgrading

We recommend that you perform a local backup of the files and database before upgrading. It is also best to test on a development instance before performing the same steps on production. We also recommend that you:

Upgrading to the next major release

Example below:

composer require magento/product-community-edition 2.2.7 --no-update
php -d memory_limit=4096M /usr/local/bin/composer update
php -d memory_limit=4096M /usr/local/bin/composer -v install
php -d memory_limit=4096M bin/magento setup:upgrade
php -d memory_limit=4096M bin/magento setup:di:compile
php -d memory_limit=4096M bin/magento setup:static-content:deploy

For more info please see Magento's upgrade documentation.

Upgrade to 2.3.1 using the Magento script

Example below

wget https://raw.githubusercontent.com/magento/magento2/2.3.0/dev/tools/UpgradeScripts/pre_composer_update_2.3.php
php -f pre_composer_update_2.3.php -- --root=/srv/public_html --repo=https://repo.magento.com/
php -d memory_limit=4096M /usr/local/bin/composer update 
php -d memory_limit=8000M bin/magento setup:upgrade
php -d memory_limit=4096M bin/magento setup:di:compile
php -d memory_limit=4096M bin/magento setup:static-content:deploy

For more info please see Magento's upgrade documentation under the heading "Upgrade using the script".

After Upgrading

php bin/magento cache:flush
/usr/share/stratus/cli cache.all.clear