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.

  1. Run the Node.js command Prompt
  2. Navigate to your project e.g.
    CD SiteFiles\MyWebsiteProject 
  3. Make sure all current dependencies are installed. You should already have a composer.json file in the root of your Magento site
    composer install
  4. 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
  5. Update your Magento database schema and data
    php bin/magento setup:upgrade
  6. 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
  7. Reindex your website
    php bin/magento indexer:reindex
  8. Flush the cache
    php bin/magento cache:flush
  9. Check that you are now running the new version
    php bin/magento --version

Leave a comment