Magento 2 upgrade to latest versionMagento 2
As we all know that Magento releases frequently new version for 2.x.x with new features and fixes. So developing anything with the version might leave you in a state that you miss some of the features from the latest version. So here, we are showcasing different approaches to upgrade your default Magento 2.x.x to latest Magento version in Windows.
Mainly there are two possible ways to upgrade it to latest version:
1. Through Setup Wizard in Magento Admin
Magento 2 setup wizard has an option to system upgrade in Magento Admin, using which one can upgrade. Usually, it is a multi-step process and it can keep your shop offline, so it is recommended to do at specific time. By default, one can set maintenance mode and keep custom thing Back-up.
You can follow below steps to upgrade your Magento version:
- Log-in to your Magento Admin
- On the Admin Menu sidebar, Choose System -> Tools -> Web Setup Wizard.
- Click on Extension Manager as in below screen.
- Once clicked on Extension Manager, it will show popup with asking for Public and Private Access key, which can be fetch by login into Magento marketplace.
(Note – Follow the on screen instruction to generate them)
- Once you apply Public and Private Access Keys and sign in, then further need to follow only steps shown on screen – Select Version –> Create Backup –> System Upgrade
There are some possible issues which you can face when you upgrade Magento 2 from local system with xampp, as seen in below screen:
It is related to SSL certificate problem which can be resolve by following performing below mentioned steps:
- For this you need to add cacert.pem file in your xampp setup and define that placed file path to php.ini.
- Use below code and also don’t forget to remove “;” before the line cainfo & openssl.cafile.
curl.cainfo = “D:\Projects\xampp\php\cacert.pem”
openssl.cafile = “D:\Projects\xampp\php\cacert.pem”
Once this is set properly you need to restart Apache Server, after that you will be able to continue your upgrade process for Magento 2.
2. With CLI (Command Line)
Another option to upgrade Magento 2 to latest version is using Command Line as seen below screen:
You need to Connect SSH and go to Magento Root Directory structure or you can use it through your Windows command prompt if you are handling or upgrading it in local system.
These are steps to upgrade from 2.1.7 to 2.1.9 version. Go to your Root Directory of Magento installation and run following command in order to successfully upgrade to the latest version.
- composer require magento/product-community-edition 2.1.9 –no-update
- composer update
- rm -rf var/di var/generation
- php bin/magento cache:flush
- php bin/magento setup:upgrade
- php bin/magento setup:di:compile
- php bin/magento indexer:reindex
If all steps are executed successfully in appropriate hierarchy, then your Magento version will get update to latest version, which you can confirm in Admin section.
These are the two ways to easily upgrade to the Latest Magento version and get rid of bugs from default or core function without any extra coding.