How to Upgrade/Update via Command Line & Composer in Magento 2

The post is researched by Mageplaza’s specialists to guide the user how to upgrade/ update Magento 2 version when using the command line & composer. Let’s take a look at what I am giving you in this document.

Overview of updating via command line & composer in Magento 2

  • Step 1: Run command on terminal/command-prompt
  • Step 2: Check the current Magento 2’s version

Step 1: Run command on terminal/command-prompt

Using the following command on terminal/command-prompt firstly:

composer require magento/product-community-edition 2.1.1 --no-update
composer update
rm -rf var/di var/generation
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

You should run compile and reindex for better performance after upgrading.

.. Note:: In Ubuntu/Debian Linux, when you meet the permission issues, remember to insert sudo at the beginning of every command like sudo composer update.

Step 2: Check the current Magento 2’s version

Next, you can check the Magento 2’s version by running the command.

php bin/magento --version

If the system show the cache write permission error, please add the following command to give write permission to pub and var directories:

chmod -R 777 pub var

That is all things you will use to upgrade/update Magento 2’s version via command line & composer. Thanks for your reading and please comment below if there is any trouble in that.



Next tutorial:

Module Development Series



Enjoyed the tutorial? Spread it to your friends!

magento-2-tutorial
upgrade
update
via
command
line
composer

Comments for How to Upgrade/Update via Command Line & Composer in Magento 2

Please leave comments if you have any questions, feedbacks.

Module Development

You also may like these Magento 2 Extensions

One Step Checkout

$199
10 reviews

Layered Navigation

$99
12 reviews

SEO

FREE
no review

Shop By Brand

$99
3 reviews

People also searched for:

  • magento 2 upgrade update via command line composer
  • magento 2 upgrade composer
  • magento 2 latest version
  • upgrade magento 2 command line
  • magento 2.1 upgrade
  • magento 2 upgrade command
  • magento 2.1.2 upgrade
  • sorry we can't take that action right now. magento 2 upgrade
  • magento 2 system upgrade
  • How to Upgrade via Command Line in Magento 2
  • upgrade update via command line in magento 2
  • update via command line in magento 2
  • upgrade via command line in magento 2