How to Upgrade Magento Version from 2.2.x to 2.3.0?

After a long wait, Magento version 2.3.0 is finally available for the community. You can download Magento version 2.3.0 from the official Magento Website. Many developers have already started upgrading their stores. However, some of the developers are looking for step by step guide on how to upgrade Magento version from 2.2.x to 2.3.0. In this article we, will show you step by step how to upgrade Magento version from 2.2.x to 2.3.0 .

Preparing Your Site for Upgrade

First thing one should always do before upgrading is to backup Magento 2 site. You can take a Magento 2 site files and database backup using Magento 2 admin panel. Go to Magento 2 admin > System > Tools > Backups and take backup.

After that please upgrade your PHP version to PHP 7.2 or PHP 7.1.3+ as Magento 2.3 no more support PHP version lower than 7.1.3

Upgrade Magento version from 2.2.x to 2.3.0

After taking backup, follow below steps to upgrade your Magento 2 site version from 2.2.x to 2.3.0

Step 1: Update composer.json file. Navigate to your Magento 2 installation root path and run below command

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

Step 2: Run below command to add additional packages to composer.json file.

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

Step 3: Remove unused packages from composer.json file.

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

Step 4: Open composer.json file to add “Zend\\Mvc\\Controller\\”: “setup/src/Zend/Mvc/Controller/”: around line 47 under psr-4 section.

"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: Run below command

composer update

This command will take some time to finish and it will actually download all the required packages and upgrade your website. After this command finish, run below commands

Step 6: Clear cache and regenerate code.

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy -f

That’s all. You have successfully upgrade your Magento version from 2.2.x to 2.3.0

Remember, One should always upgrade Magento 2 website to it’s latest version to make your store bug free. Hope this article will help you.

Getting error while upgrade? Please leave us a comment below.

Leave a Comment

(10 Comments)

  • Leonard

    Hello,

    When I try to upgrade I get this error:

    “`
    CONSTRAINT `CATALOG_PRODUCT_ENTITY_VARCHAR_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE), query was: ALTER TABLE `catalog_product_entity_varchar` MODIFY COLUMN `entity_id` int(10) UNSIGNED NOT NULL DEFAULT 0 , MODIFY COLUMN `value` varchar(255) NULL COMMENT “Value”, ADD CONSTRAINT `CAT_PRD_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE, ADD CONSTRAINT `CAT_PRD_ENTT_VCHR_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE, ADD CONSTRAINT `CATALOG_PRODUCT_ENTITY_VARCHAR_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
    “`

    Thank you.

  • Rakesh Gupta

    I followed your instructions to update my Magento 2.2.6 to 2.3 but it failed at command > composer update

    Following is the error I’m getting :

    globltec@sg06 [NEW ~/public_html]# composer update
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.

    Problem 1
    – Installation request for magento/product-community-edition 2.3.0 -> satisf iable by magento/product-community-edition[2.3.0].
    – magento/product-community-edition 2.3.0 requires msp/recaptcha ^2.0.1 -> s atisfiable by msp/recaptcha[2.0.1, 2.0.2] but these conflict with your requireme nts or minimum-stability.

    globltec@sg06 [NEW ~/public_html]# ^C
    globltec@sg06 [NEW ~/public_html]#

    • Chirag

      Please try to disable msp/recaptcha module and check

      • Rakesh Gupta

        Tried your suggestion :

        globltec@sg06 [NEW ~/public_html]# php bin/magento msp:security:recaptcha:disable
        globltec@sg06 [NEW ~/public_html]# composer update
        Loading composer repositories with package information
        Updating dependencies (including require-dev)
        Your requirements could not be resolved to an installable set of packages.

        Problem 1
        – Installation request for magento/product-community-edition 2.3.0 -> satisfiable by magento/product-community-edition[2.3.0].
        – magento/product-community-edition 2.3.0 requires msp/recaptcha ^2.0.1 -> satisfiable by msp/recaptcha[2.0.1, 2.0.2] but these conflict with your requirements or minimum-stability.

        globltec@sg06 [NEW ~/public_html]#

        But still getting same problem/error.

      • Rakesh Gupta

        Sorry no success till now. Waiting for someone to help in upgrading.

        • Chirag

          Can you please check the minimal stability of magento/product-community-edition in msp/recaptcha module composer.json file? Or clear the composer cache using

          composer clear-cache

          and try again.

          • Rakesh Gupta

            How do I check minimal stability.

            The contents of msp/recaptcha composer.json file is as below :

            {
            “name”: “msp/recaptcha”,
            “description”: “Google reCaptcha integration for Magento2 – Member of MageSpecialist SecuritySuite”,
            “version”: “2.0.0”,
            “require”: {
            “php”: “^7.0|^7.1|^7.2”,
            “magento/magento-composer-installer”: “*”,
            “google/recaptcha”: “^1.1”
            },
            “suggest”: {
            “msp/security-suite”: “Full MageSpecialist Security Suite”
            },
            “authors”: [
            {
            “name”: “Riccardo Tempesta”,
            “email”: “riccardo.tempesta@magespecialist.it”
            }
            ],
            “type”: “magento2-module”,
            “license”: “OSL-3.0”,
            “autoload”: {
            “files”: [
            “registration.php”
            ],
            “psr-4”: {
            “MSP\\ReCaptcha\\”: “”
            }
            }
            }

            Please guide….

        • Admin

          By looking at a composer.json file, I can tell you that ReCaptcha version is 2.0.0 and Magento require Recaptcha version 2.0.1. I would suggest you should remove the ReCaptcha module completely as 2.3.0 inbuilt provide google ReCaptcha

          • Rakesh Gupta

            This also did not worked. Hence, decided to remove existing Magento 2.2.6 from Server and install 2.3 after data backup.

  • Alex

    Thanks! It helped a lot.

  • All the comments are goes into moderation before approval. Please do not spam. Your email address will not be published. Required fields are marked *

    Enjoy this post? Please support Us!

    Like our social page for daily new updates….


    Want to become
    a Magento 2 Expert?

    If Yes! Then Subscribe to our newsletter and get weekly article to you email id.
    Subscribe Here
    SUBSCRIBE NOW
    close-link

    To Avoid Spam Downloads, We Want Your Email

    We will send you download link right
    away. Please submit form below.
    SEND ME DOWNLOAD LINK
    Close