Magento 2 Upgrade in 3 Easy Steps
3 Ways to Upgrade Magento 2 Installation
- Magento composer update. That is using Composer, a terminal command line program.
- Upgrade Magento from admin using the Web Setup Wizard.
- Copy the Magento 2 latest version over the old installation.
1. Using Composer
Run this SSH command:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Login to your server and go to the Magento root folder (usually it is ~/public_html):
cd ~/public_html
Then remove everything in the vendor folder:
rm -rf vendor/*
update Magento 2 with Composer:
composer update
run the following command to update to the latest Magento release:
composer require magento/product-enterprise-edition 2.2.5 --no-update
composer update
Note: Replace 2.2.5 with the latest M2 version
When it is completed, run another SSH command and upgrade the Magento database:
php bin/magento setup:upgrade
that you will want to recompile if you are in production mode:
php bin/magento deploy:mode:set production
This is it. You’ve successfully performed a Magento 2 upgrade! Now go to the frontend and backend and check everything.
2. Using the Web Setup Wizard in the Admin Menu
- Login to Magento backend.
- Go to http://shop.com/admin_xxx/admin/backendapp/redirect/app/setup/. http://shop.com/admin_xxx is path your backend.
- You will be automatically redirected to http://shop.com/setup/#/home. There you will select System Upgrade.
3. Download the latest version manually and copy/paste
Download the latest Magento 2 off the official website. Unzip it in your magento main folder. That will overwrite the core files with the new ones.
Then run:
php bin/magento setup:upgrade
php bin/magento deploy:mode:set production
That will upgrade database, compile and deploy static content. It might require some time depending on the number of products, orders and customers you have.
Upgrade is done. Head to frontend and backend and see if everything looks normal.