0

I installed Magento2 via composer, following this guide.

Now I see version 2.1.6 is available and I'd like to upgrade. Please confirm if these commands will do the trick or what I'm missing in case they're wrong.

Note this site is in production mode

./composer.phar self-update
./composer.phar update
bin/magento cache:flush
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
2
  • You need to specify the version you want. Thats why you don't see any changes, as composer does update nothing here. It just checks if all files are valid, based on its version.
    – Max
    Commented Apr 27, 2017 at 15:17
  • @Max Ah, right, need to set the version to 2.1.6 in composer.json first I presume. Commented Apr 27, 2017 at 15:58

1 Answer 1

3

This other answer covers most of what you need.

However, it doesn't address one important thing: if you're in a Production environment, you should add some flags the composer update command in order to make things clean & lean, as follows:

./composer.phar update --no-dev --optimize-autoloader

Also, the order of the commands that I'd use would be as follows:

./composer.phar self-update
./composer.phar update --no-dev --optimize-autoloader
rm -rf var/di var/generation
# not necessary if already in production:
# bin/magento deploy:mode:set production -s
bin/magento cache:flush
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento indexer:reindex 
1
  • 1
    Needless to say: you shouldn't upgrade your Magento version straight in Production: if you want to be safe, do it first in a development environment, and then test in a pre-production environment. But that's besides the question. Commented Apr 27, 2017 at 15:25

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.