Updating your Magento 2 installation is very easy if you use composer. Below you will find all the steps you need to take to update the system quickly. Updating through composer can be done both with the Community Edition as well as the Enterprise Edition.
Open up your favorite CLI (Command Line Interface) and navigate to the root of your Magento 2 installation. Start to follow the steps outlined below.
- Download the update with composer that fits your version of the system (CE or EE). Please be aware that you need to change the version numbers to the most recent one when you’re reading this.
Community Edition: composer require magento/product-community-edition x.x.x --no-update Enterprise Edition: composer require magento/product-enterprise-edition x.x.x --no-update
- Execute the update by using the following command
composer update
- Remove some folders
rm -rf var/di var/generation
- Clear cache, upgrade, compile and reindex
php bin/magento cache:flush php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento indexer:reindex
- Check the Magento 2 version number by running this command
php bin/magento --version
You have now succesfully upgraded your Magento 2 installation with composer! If you have any more questions, don’t hesitate to ask us in the comments below this article, and we’ll answer them as soon as possible!
The post How to Update Magento 2 using Composer appeared first on Coding Basics.