It’s always better to keep your Magento 2 store up to date with the latest version. Because every Magento 2 release has lots of new features, performance improvements, code enhancements, and security patches. We can upgrade the Magento 2 version in two ways, through an admin panel and CLI command. In this blog, I am going to explain both the ways.
Via Admin Panel:
Here the steps to upgrade the Magento version from 2.1.7 to 2.2.5 via Magento admin panel,
1. Log in to your Magento admin panel as an administrator.
2. Navigate to System > Tools > Web Setup Wizard. The following page will be displayed.
3. Click on “System Configuration”. Then the following page will be displayed.
4. Enter your authentication keys and click “Save Config”. If you don’t know about how to get your authentication keys, refer to this tutorial Get your authentication keys.
5. After saving the authentication keys, the page will look as follow,
6. Then, Click “System Upgrade” in the left sidebar.
7. System Upgrade: Select the latest version in the dropdown and select the “Next” button.
8. Readiness check: If everything is green, Click “Next” button. If not, fix all the issues before click “Next” button.
9. Finally, click the “Upgrade” button.
Via CLI Command:
1. Log in to your server as a system owner via SSH and navigate to Magento root folder.
2. Enter the following command to enable maintenance:
php bin/magento maintenance:enable
3. Enter the following command
composer require magento/product-community-edition 2.2.5 –no-update
It will show the following output
./composer.json has been updated
4. Then enter the following command,
5. If prompted, enter your authentication keys.
6. Manually remove the “var” subdirectories by using the below commands,
rm -rf <Magento installed root dir>/var/cache/*
rm -rf <Magento installed root dir>/var/page_cache/*
rm -rf <Magento installed root dir>/var/generation/*
7. Enter the following command to update the database schema and data
php bin/magento setup:upgrade
8. Finally, disable the maintenance mode by using the below command
php bin/magento maintenance:disable
Hope this helps.