How to upgrade Magento 2 version via backend or terminal


In its last year of being Magento’s flagship Community Edition product, Magento 1.9 had a lot of service upgrades and patches. There were at least 11 patches along with several other vendor specific updates that had to be done. Once those were done you had to visually review your site to make sure your block types were authorized. Several site owners reported that site features no longer appeared on their site, only leaving a blank. If this happen to you each block type had to be authorized individually potentially adding dozens of developer hours.

Fortunately,  the core team of developers for Magento 2 addressed this issue in the latest installment.  Previously, I explained how to install Magento 2, now I will explain how to upgrade magento 2 version. In Magento 2 you have two ways now to upgrade your site. Well, a third but it’s really just a caveat to the second one if you have sample data installed.

As it is with any Model View Controller (MVC) or Model View View Model (MVVM) framework it is highly important to follow convention. What happens if you don’t or if you “edit core” files is that the upgrades will override all of your hard work. So the idea is to make your own themes.  It’s ok to simply copy the blank or Luma theme and start from there.

Let’s get down to the details.  The first is the easiest. For those that are less technical or do not desire to get into the command line it can be done through the admin area. In this tutorial, we are going to upgrade Magento from 2.0.x to 2.1.x

Admin Area Upgrade

Navigate to System > Web Setup Wizard > System Upgrade

how to upgrade magento 2 step 1

Once your in this area we have to do a couple things.

Step 1: Select your version.To keep this blog current I won’t identify which version to select but Magento will let you know the most current by putting the word (latest) in parenthesis next to the newest version.

how to upgrade magento installation 2

Step 2: You will see a readiness check. Green means go.

how to upgrade magento installation 3


Step 3: When ready press the upgrade button.

Terminal Area Upgrade

Before you start please apply the MDVA-532 patch, open your terminal and enter this:

Next enter the following line to update the database schema and data.

As with any upgrade you will need to validate your results and perform a quality assurance check.  QA checks are best performed by several people so that things aren’t missed. Have people evaluate the whole process flow from the homepage all the way through checkout.

Earlier in this article I identified a caveat. If you started development with using Magento 2’s sample data then your only option is to use the terminal.

Terminal Area Upgrade if sample data was used

If sample data was had installed, you can only upgrade Magento 2 installation via terminal.

Note: Remember to back up your composer.json file before proceeding.

Enter the following into the terminal:

For this next piece, I have prepared for you, just copy and paste it to terminal:

Next, enter this line

This will take some time as it is a big chunk of code. Once its done reset your file permissions.

It goes without saying make sure that you backup your site before you do any upgrades. Take it a step further and test on a development server. That way if the site crashes you won’t lose revenue.

Rate this post


About Author

Magento customization experts have just shared guidelines to upgrade magento 2. If you have doubts, you can ask in comments.

Leave A Reply