Magento 2 update
In this tutorial I show you how to update Magento 2 to a newer version. I had to do this recently because of some needed bugfixes. Updating Magento 2 was less complicated as expected. With composer it is a quite easy task. I show you all you need to know.
Magento 2 update
First of all you need a SSH connection to your Magento shop. You need to run this update with composer, so composer should be installed on this system. We track all our projects with Git, so I did this offline on my Linux Desktop – after Update I was able to commit all changes to Git. This is not needed, but a good option, because if you detect errors or wrong behaviors you can always get back to recent version.
Access Key
For an update, you need an access key from Magento. To get it, login on official Magento website with your account. On “Marketplace” tab, you will find a link to “My Access Keys”. There you can generate a new pair of private and public keys.
Composer
The whole update process is done with composer. You may install it with:
1 | sudo apt-get install composer |
If it is already installed on your system you can update you composer file with
1 | composer require magento/product-community-edition 2.1.5 --no-update |
In that case I updated a Magento 2.1.0 to current 2.1.5 version. You may need to update to a version with a far higher version number if you read this. Just change version number. Now your composer.json file is updated with this information. You no start an update with:
1 | composer update |
You now need to set you authentication. Just put your key (public for username, private for password). You can copy past from your browser.
If everything is fine, update will run automatically. You will see, that composer updates every single project (module) inside your vendor folder:
Errors
If your environment does not fit the required configuration, you will get an error message like:
1 | Your requirements could not be resolved to an installable set of packages. |
You will get detailed information on this error and which plugin is missing. For me, this were various php modules. In current case it was ext-gd, as seen in screenshot:
The solution for my error was to install php gd library on my desktop system. On my next run, composer complained about the next error. All in all I had to install the following libraries:
- gd
- mcrypt
- intl
- zip
The reason for this was my environment. On a configured web server you may run it without error. If you do it on your machine (Linux, Windows or Mac OSX), you may need to install even more additional libraries. Be prepared to do it.
Conclusion
Magento 2 update is very easy. If you did no core hacks, it should work out of the box. I showed you how to run a composer update and how to fix possible errors.
I never thought that the process of updating Magento 2 version would be so simple. But should I be concerned about any deprecated functions when updating the version? Also, according to this article (https://magenticians.com/update-magento-2-using-composer/ ) there is also need for verifying the update. Is this verification required?
Deprecated functions can only be a problem caused by 3rd party modules. You need to check such things on your development system. Your linked article only mentions, that you verify Magento version in adminhtml. You should verify this, but it should show correct number if you did all steps mentioned for Magento 2 update.