Updating Magento 2 locally with Composer
Magento 2 deployment is a bit more advanced than Magento 1.x. so you’ll need to have already set up your site locally using Vagrant, Wampserver or similar.
- Run the Node.js command Prompt
- Navigate to your project e.g.
CD\
CD SiteFiles\MyWebsiteProject
- Make sure all current dependencies are installed. You should already have a composer.json file in the root of your Magento site
composer install
- Get the newer version of Magento (change the version number as required)
composer require magento/product-community-edition 2.1.2 --no-update
composer update
- Update your Magento database schema and data
php bin/magento setup:upgrade
- Compile your code. Use the second line if you need to allocate more memory to the process
php bin/magento setup:di:compile
php -dmemory_limit=6G bin/magento setup:di:compile
- Reindex your website
php bin/magento indexer:reindex
- Flush the cache
php bin/magento cache:flush
- Check that you are now running the new version
php bin/magento --version