How to update your Magento 2 installation

updating_magento2-featured

In my previous article How To Install Magento 2, I explained how to install Magento 2, now I will explain how to update it.

Again, similarly like there are multiple ways to install it, there are multiple ways to update it. Go figure. Actually, you don’t have to go figure, just read on 🙂

The first and easiest is to update it from Magento “Web Setup Wizard”.
The second way is to update from command-line or terminal.

I will be updating from Magento 2.0.2 to Magento 2.1.0 with and without sample data, because there is a slight difference in how Magento is updated.

1. Web Setup Wizard

Updating Magento 2.0.2, without sample data to Magento 2.1.0 requires a patch! Yes, you read this correctly. You need to apply patch MDVA-532 to successfully update Magento.
Downloading patch and installing is easy. So head out to http://www.magento.com/download, download it and apply patch.

Go to:

System > Web Setup Wizard > System upgrade

system-upgrade
You will see a few steps that we must go through.

  1. Version select. I will select “Version 2.1.0 CE”, because this is the latest version of Magento, at the time of writing this article.
  2. Readiness check. If everything is green go to next step. If not, make sure you have cron jobs running, or refer to the official Magento documentation
  3. Hit “Upgrade” button!
  4. Wait untill you see this screen

installation-completed

2. Terminal

This approach also requires patch MDVA-532 so go ahead and apply it.
Then enter these commands in terminal:

composer require magento/product-community-edition 2.1.0 --no-update
composer update

After this is completed run:

php bin/magento setup:upgrade

to update database schema and data.

Visit the homepage to see your updated Magento 2. If you get some errors, reset file permissions and ownership and then clean cache.

3. With sample data – Terminal

If you have sample data installed, your only option to update to 2.1.0 is through terminal. Only Enterprise edition with sample data can update to 2.1.0 through Web setup wizard.

Please back up your composer.json file before continuing.

Enter the following into the terminal:

composer require magento/product-community-edition 2.1.0 --no-update

Now copy and paste this big chunk of command:

composer require magento/module-bundle-sample-data:100.1.0 magento/module-widget-sample-data:100.1.0 magento/module-theme-sample-data:100.1.0 magento/module-catalog-sample-data:100.1.0 magento/module-customer-sample-data:100.1.0 magento/module-cms-sample-data:100.1.0 magento/module-catalog-rule-sample-data:100.1.0 magento/module-sales-rule-sample-data:100.1.0 magento/module-review-sample-data:100.1.0 magento/module-tax-sample-data:100.1.0 magento/module-sales-sample-data:100.1.0 magento/module-grouped-product-sample-data:100.1.0 magento/module-downloadable-sample-data:100.1.0 magento/module-msrp-sample-data:100.1.0 magento/module-configurable-sample-data:100.1.0 magento/module-product-links-sample-data:100.1.0 magento/module-wishlist-sample-data:100.1.0 magento/module-swatches-sample-data:100.1.0 magento/sample-data-media:100.1.0 magento/module-offline-shipping-sample-data:100.1.0 --no-update
composer update

Now you wait…:)

When finished, reset file system permissions.

Then run:

php bin/magento setup:upgrade

Don’t do this immediately on live site, please test it first on dev environment.

And there you go – several ways to update your Magento 2 installation.

If you experience any problems, you should refer to http://devdocs.magento.com/guides/v2.0/release-notes/tech_bull_21-upgrade.html to get some ideas.

What’s your experience in updating Magento 2? Smooth sailing or troubled waters?


About Ivan Veres

Backend Developer

Ivan is a Backend Developer who has equal amounts of love for programming, paragliding and weekend barbecues near the lake.

Read more posts by Ivan / Visit Ivan's profile

5 comments

  1. Thanks for sharing. Terminal method works but it asks to re-run compile command. Is it necessary?

  2. Great tutorial, Ivan. I have one question, also. What do you think is the best solution, after a local update is done, for sending files to server? Do you think copying all files to server is the best way of upgrading M2, or you maybe have some other way of syncing files on local machine and server?
    Thanks,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.