3 Ways to Upgrade Magento 2 Installation
- Using a terminal command-line program, Magento Composer.
- Using the Web Setup Wizard Upgrade
- Copy/Paste the latest Magento 2 version
USE MAGENTO COMPOSER
The first and most effective method to upgrade the Magento 2 installation. Then it is relied on using the Magento Composer.
Actually the Composer is a dependency manager in PHP.
1. Please ensure that you have logged in as a Super Admin/System owner. Then move to the Magento 2 root folder
cd ~ /public_html
2. Using the following command, switch to the Maintenance mode,
php bin/magento maintenance:enable
3. Empty the vendor folder by running the below-mentioned command,
rm -rf vendor/*
4. Now open the composer.json file and choose any of your desired Magento versions.
It should not be the same as your current version. There is an alternative for you to choose from.
- Execute the Require command to request the Magento 2 package to use Composer.
- Update all the associated files.
composer require <product> <version> —no-update composer update
If you want to upgrade the current version to Magento 2.3.0 installation. Then the command line should look like as below:
composer require magento/product-community-edition 2.2.4 —no-update composer update
5. Enter the access key if you’re asked for it. Then it’s time for the installation of files.
Here the Username represents the public key. Then the password represents the private key.6. After the successful completion of the installation. It is mandatory to clear var child directories. For this, execute the commands below:
rm -rf <Magento install dir>/var/cache/* rm -rf <Magento install dir>/var/page_cache/* rm -rf <Magento install dir>/var/generation/*
Flush all the cache-related options.
7. Use the following query to upgrade the database schema,
php bin/magento setup:upgrade
8. Now you’re all set to get the store back by disabling the Maintenance mode using the command:
php bin/magento maintenance:disable
USE THE SETUP WIZARD IN THE MAGENTO 2 installation(Upgrade)
1. Open and access to your store admin as the Super-Admin.
2. Then navigate from Admin panel:
System ⇾ Tools ⇾ Web Setup Wizard.
3. Now click on the System Configuration option.
4. After the whole configuration set to complete. Click Save config and then System Upgrades.
5. After the whole configuration set to complete, Click Save config and then System Upgrades.
It is better to back up files and skip the backup step suggested by the wizard. So then if it fails and you’ll have to start the process once again.
DOWNLOAD THE LATEST VERSION MANUALLY
This is the simplest method to upgrade Magento 2 installation. So even the Magento 2 beginner can handle it.
- Download the latest version of Magento from the official Magento website.
- Move the downloaded files to the Magento 2 root folder, then unzip the whole package.
Now the Magento calls for replacing the existing files. So go for it without any second thought, click ‘Yes’.
Then run the following commands in SSH console one by one,
php bin/magento setup:upgrade php bin/magento setup:static-content:deploy php bin/magento cache:clean php bin/magento indexer:reindex
Before proceeding to the next process. Please ensure that whether every command is over or not.
The steps will help you to fix the following tasks, they are:
- Refresh the database schema
- Update all dependencies, and
- Flush caches.
The store with a lot of products and customers may take some extra time until each command is executed.
Thus, the upgrading process is almost complete. Now test your site against the following check-list for the betterment of the store.
- Check the store frontend and admin view
- Check the workflow and site compatibility
- In case if you use any third-party extension, run some smoke test
Yes, you’ve learned to upgrade a Magento 2 store installation using the above methods. (i.e. Via The Setup wizard, Magento Composer, and by uploading files).
Though you have several ways to upgrade the Magento 2 installation. But it is a must carry any Magneto 2 installation process with the help of Magento migration experts.
Related blogs: 1. How coronavirus impact the eCommerce industry/store? 2. Types of data that can be migrated during Magento migration 3. What is the need of migrating Magento 1 to Magento 2? 4. 5 useful tips for successful Magento 2 migration 5. Everything about Magento 2 Store View, Website and Multi-Store