How to upgrade Magento 2.x to 2.3

How to upgrade Magento 2.x to 2.3

In my latest article about the 2.3.0 release , I have explained how big and important this Magento upgrade is. It consists huge improvements over the current version and comes with lots of fixes and features. I would say, this is one of the biggest upgrades for Magento 2 in this year, 2018.

I would highly suggest every store owner to upgrade their Magento v2.x to latest 2.3.0 to avail all these security enhancement, features and functionalities and fixtures in their stores.

In this tutorial, I will explain on how to upgrade your current v2.x to this latest v2.3.0.

Important Note: before you run any further steps on upgrading your current store, I would suggest you to do the following:

  1. Do not try this upgrade on production environment directly until you are 100% sure it is working on your development environment.

  2. Take a full backup of your production file system and database

  3. Make sure you are running php7.1 or higher


Step 1: Put the site in maintenance:

#php bin/magento maintenance:enable


Step 2: Get the latest package through composer

Run the following command

#composer require magento/product-community-edition=2.3.0 --no-update


Step 3: Now, ideally it should allow you to run the below command, however, this will not work in the cases when you are upgrading from 2.2.X to 2.3.0.

#composer update

This will give you a similar error shown below:



The reason behind this is, Now Magneto 2.3 requires additional packages to run Magneto newest version. So before going further, you need to setup correct environment setting. Otherwise you will meet these errors and not gonna update the magento version to latest.

So before running #composer update, please specify these additional packages by running these command

#composer require --dev phpunit/phpunit:~6.2.0 friendsofphp/php-cs-fixer:~2.10.1 lusitanian/oauth:~0.8.10 pdepend/pdepend:2.5.2 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:3.2.2 --no-update

Also remove unused packages (This is optional but still good to remove any unused packages from composer) through this command

#composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update


Step 4: Still , You cannot go with #composer update , As there are some changes in composer.json file which we need to amend. For this we need to include "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"  in autoload psr-4 section.So open composer.json and edit the "autoload": "psr-4" section and include  "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"


 "autoload": {
 "psr-4": {
    "Magento\\Framework\\": "lib/internal/Magento/Framework/",
    "Magento\\Setup\\": "setup/src/Magento/Setup/",
    "Magento\\": "app/code/Magento/",
    "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
………………… } 


Step 5:  Once done, you are ready to run the composer update command

#composer update

Now the upgrade process should begin.




Now on this stage if you encounter with any error, that’s most likely because of your own configuration in the store. Please get them fixed.


Step 6: Clear caches and generated content


#rm -rf var
#rm -rf generated


Step 7: Once, that’s done, run the upgrade command


#bin/magento setup:upgrade
#php bin/magento cache:flush
#php bin/magento setup:static-content:deploy -f
#php bin/magento indexer:reindex
#php bin/magento setup:di:compile #redis-cli flushall
#php bin/magento maintenance:disable 


Done! Check your magento admin and confirm that you have the latest version of the store.

or check your Magento version with the following command:

#php bin/magento --version



In case you encounter with any errors or have any questions, please submit it through our website.



1. Which php version is required for Magento 2.3.0?

Ans: You need PHP 7.1.3+ or 7.2.x for running Magento 2.3.0.

2.  Can we go directly for “Composer Update” without adding additional Packages?

Ans: No. You must specify additional packages and must update composer.json file before using “Composer Update”. Without this there will be errors in console about requirements which need to be added.

3 .Is there some changes while defining package for Magneto 2.3.0?

Ans: Yes check

#composer require magento/product-community-edition=2.3.0 --no-update

while in old one

#composer require magento/product-community-edition 2.2.x --no-update


4. Major changes in Magento 2.3.0?


New composer packages – because there are so many new features.

Optional modules – use the replace composer trick to remove any new Magento 2.3 module that you don’t need.

MySQL search – Magento 2.3 marks the deprecation for MySQL as a search mechanism. ElasticSearch will be a replacement

Zend Framework – Magento 2.3 removes Zend Framework 1 dependencies

GraphQL API is now available with Magento 2.3.0.

Declarative schema simplifies installation and upgrade procedures for Magento and extensions. has a very powerful service architectured by our Magento team to upgrade your store from any version to latest Magento 2. Please visit our Upgrade Service for Magento 2 page and get more details about this service. Do let us know if we can be of any assitance to help you upgrading your Magento store.