How to update your Magento 2 installation
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.
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
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
Now you wait…:)
When finished, reset file system permissions.
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!
Hey! Actually, Updating Magento 2.0.2, without sample data to Magento 2.1.0 requires a patch! Yes, I read this correctly. I need to apply patch MDVA-532 to successfully update Magento.
I seem to be struggling. For some reason I get component conflicts in the readiness check. But I don’t know what is conflicting.
My crons seem to pass the test.
Is there anything else I can try? I am using CE trying to update to 2.1.7 I am using cpanel and don’t have access to the server.
Could I be missing a cron? Below is the crons I have in place.
/usr/bin/php -q /home/steelcit/steelcitysports.co.uk/script.php
/usr/local/bin/php /home/steelcit/steelcitysports.co.uk/bin/magento setup:cron:run >> /home/steelcit/steelcitysports.co.uk/var/log/setup.cron.log
/usr/local/bin/php /home/steelcit/steelcitysports.co.uk/bin/magento cron:run | grep -v “Ran jobs by schedule” >> /home/steelcit/steelcitysports.co.uk/var/log/magento.cron.log
/usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/cli.php –backup –auto=1 –insid=72_73911
/usr/bin/php /var/www/steelcitysports.co.uk/bin/magento cron:run | grep -v “Ran jobs by schedule” >> /var/www/steelcitysports.co.uk/var/log/magento.cron.log
/usr/bin/php /var/www/steelcitysports.co.uk/update/cron.php >> /var/www/steelcitysports.co.uk/var/log/update.cron.log
/usr/bin/php /var/www/steelcitysports.co.uk/bin/magento setup:cron:run >> /var/www/steelcitysports.co.uk/var/log/setup.cron.log
I am new to Magento and crons
Any help will be appreciated.
Here is what you might do: download a fresh copy of the latest M2 and just copy it over your old files.
Then run php bin/magento setup:upgrade
Backup files and DB first.
Report back how it went.
We used migration service by plumrocket and that was really effortless.
I think you mean you work for them..
Thanks for sharing. Terminal method works but it asks to re-run compile command. Is it necessary?
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 for your help 😀 i did the udate 2.0.4 -> 2.1.0 with this post …. so happy!!!
thank you, this is a really help to me !!!