Upgradation is what makes you relevant all the time, in competitive world it is even more necessary to survive.
If you are planning to update your e-commerce Magento 2 powered store then you can follow different methods to do so.
One should trace their backup files and secure them before moving ahead.
Mode 1: Use Magento Composer
It’s the most stress free method of updating. Let’s run through the process in sequential manner:
- Logged in as device owner (login user) and navigate to the root folder Magento 2 cd ~/public html
- Switch to Maintenance mode via the php bin / magento maintenance command: turning enable
- Clear everything within the vendor folder by running the rm -rf vendor/ * command
- Open the composer.json file and change your Magento’s current version into the required one, as shown in the screenshot below:
Similarly, you can execute the Require command to allow Composer to use the Magento 2 kit and upgrade the related files:
Composer requires < product > < version >-no update
- If necessary indicate access keys. You can get them via the link below. After logging in, this is what you will see:
Username corresponds to the public key and password corresponds to the private key.
The installation of files will begin after you enter keys.
- You will need to clear var child directories once the installation is complete.
rm -rf <Magento install dir>/var/cache/*
rm -rf <Magento install dir>/var/page_cache/*
rm -rf <Magento install dir>/var/generation/*
If you use Varnish, Redis, Memcache, or another caching option, remember to flush them as well.
- Use another query to update the database schema after you clear subdirectories: php bin / magento setup: upgrade
- Disable the Maintenance mode and put your store back to work by running the command:
php bin/magento maintenance:disable
Mode 2: Using the Web Setup Wizard in the Admin Menu
The second method is simpler to use and matches those not so good at using Magento 2 Composer.
- Use full permissions (super-admin) to access your store admin side as a user.
- Navigate to System -> Tools -> Web Setup Wizard. You will see the following menu:
- Select the System Configuration option.
- In the respective fields you may be asked to define authentication keys. You can get the keys to Magento Marketplace again.
- Click Save config and then System Upgrades.
You’ll get detailed instructions during the upgrade process so there shouldn’t be any issues. Note that you may be asked to upgrade PHP at the Readiness check process step since M2.0, M2.1, and M2.2 support different versions of PHP.
Mode 3: Download the latest version manually and copy/paste.
Upgrade this way if for whatever reason the previous two failed.
- Download Official Website of the latest Magento 2. Unzip it in your key folder Magento. With the new ones this will delete the main files.
php bin/magento setup:upgrade
php bin/magento deploy:mode:set production
- That will upgrade, compile and deploy static content to the database. Depending on the number of products, orders and customers you have, this may take some time.