How to upgrade Magento 2 to a later version
June 9th, 2017
Warning: This post is 7 years old. Some of this information may be out of date.
Here's how to upgrade Magento 2 to a later version. For example, if you are currently running 2.1.6 and you need to upgrade to 2.1.7. Make sure you are in your Magento 2 public_html directory before you start.
- Put your store in maintenance mode:
php bin/magento maintenance:enable
- Update the composer.json with the latest upgrade version:
composer require magento/product-community-edition 2.1.7 --no-update
- Update the files:
composer update
- Clear the
var
cache files:
rm -fr var/{cache,page_cache,generation}/*
- Update the Database:
php bin/magento setup:upgrade
- Run Magento compile command:
php bin/magento setup:di:compile
If you get memory issues, run this with more memory:
php -d memory_limit=4G bin/magento setup:di:compile
- Turn off Maintenance mode:
php bin/magento maintenance:disable
- Revisit your site admin and check the version number in the footer.