I updated my Magento Open Source installation to version 2.1.9. I did the upgrade via Composer by first modifying my root composer.json file to require the higher version, like so:

"require": {
    "magento/product-community-edition": "2.1.9", <--modify this line

And then run console command "composer update". Composer magically does all the job of flawlessly updating my entire Magento System in the span of several minutes. (side note: I just don't know how people update Magento without Composer, cheez.) Anyway, it's a localhost installation, so I don't care about backing up databases and such.

Since I didn't find one concise answer to what Magento CLI commands do I need to run after version update, so this is my question.

I suppose the first command to run would be (from root):

php bin/magento cache:clean

But then, do I need to run setup:di:compile ? Do I need to run setup:static-content:deploy ?

Do I need to delete files from pub/static/adminhtml and frontend? Any other folders' contents in pub/static to delete? Should I delete contents in var/generation and var/view_preprocessed ? Any specific folders to delete in the mentioned paths or just delete it all?

What are the specific steps for best system setup after version upgrade?

1 Answer 1


After upgrade you should run:

  1. setup:upgrade - to upgrade a data stored in the database (if needed)
  2. setup:static-content:deploy - if you are using the copy strategy for the static content
  3. setup:di:compile - compilation for the production mode
  4. indexer:reindex - in case indexes have some changes

You can get more info here

PS: there is no need to manually remove an old files if your system was configured correctly (access rights etc.). All files will be overwritten with new ones, and the entire cache will be cleared during the setup: upgrade process.

  • So, there is no need to run setup:di:compile in developer mode, is this correct ? Sep 19, 2017 at 9:15
  • @IvetaAllogenes Sure, compilation is required only in production or if you want to test performance of your changes with a compiled files. Usually in the development mode you make changes in the regular files, but not in a compiled ones. Sep 19, 2017 at 9:19

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.