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
You will see a few steps that we must go through.
- 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.
- 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
- Hit “Upgrade” button!
- Wait untill you see this screen
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?
In case you feel you need some extra help, we can offer you a detailed custom report based on our technical audit – feel free to get in touch and see what we can do for you!