0

Sorry, I am a newbie in Magento and I have several problems with updating Magento.
I am using this tutorial for doing so https://blog.magestore.com/upgrade-magento-2-3/
I am using community edition so I tried to follow Upgrade Magento 2.3 manually and Command-line upgrade
When I follow Command-line upgrade my bin/magento was simply deleted and not available anymore.
Then I clone again my project in magento and try to follow Upgrade Magento 2.3 manually
but then :

php bin/magento setup:upgrade

PHP Fatal error: Uncaught Error: Class 'Zend\Mvc\Controller\LazyControllerAbstractFactory' not found in /var/www/BQE/magento/vendor/zendframework/zend-servicemanager/src/ServiceManager.php:314 Stack trace:

0 /var/www/BQE/magento/vendor/zendframework/zend-servicemanager/src/Config.php(137):

Zend\ServiceManager\ServiceManager->addAbstractFactory('Zend\Mvc\Contro...')

1 /var/www/BQE/magento/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php(225):

Zend\ServiceManager\Config->configureServiceManager(Object(Zend\Mvc\Controller\ControllerManager))

2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))

3 /var/www/BQE/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(490):

call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent))

4 /var/www/BQE/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(248):

Zend\EventManager\EventManager->triggerListeners('loadModules.pos...', Object(Zend\ModuleManager\Mo in /var/www/BQE/magento/vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 314

Does someone add a similar issue? I mean what I do wrong ? I follow the tutorial step by step and is not working.

PS: Please in case of minus let me know why so that I can improve my post
EDIT : my composer.json

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.2.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "magento/product-community-edition": "2.3.0",
        "composer/composer": "@alpha",
        "msp/devtools": ">=1.2",
        "magepal/magento2-gmailsmtpapp": ">=1.5",
        "mailchimp/mc-magento2": "^1.0",
        "ebizmarts/magento2-mandrill": "^3.0",
        "mirasvit/module-search-ultimate": "*"
    },
    "require-dev": {
        "phpunit/phpunit": "~6.2.0",
        "squizlabs/php_codesniffer": "3.2.2",
        "phpmd/phpmd": "@stable",
        "pdepend/pdepend": "2.5.2",
        "friendsofphp/php-cs-fixer": "~2.10.1",
        "lusitanian/oauth": "~0.8.10",
        "sebastian/phpcpd": "~3.0.0"
    },
    "config": {
        "use-include-path": true
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/"
        },
        "psr-0": {
            "": "app/code/"
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "minimum-stability": "alpha",
    "prefer-stable": true,
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://repo.magento.com/"
        },
        "amasty": {
            "type": "composer",
            "url": "https://composer.amasty.com/community/"
        },
        "mirasvit-ssu2": {
            "type": "composer",
            "url": "https://27584:4NW7YLV1DJ@packages.mirasvit.com/"
        }
    },
    "extra": {
        "magento-force": "override"
    }
}
  • magento.stackexchange.com/a/195050/51810 you can follow this answer. Update your magento version in that command. – Rohan Hapani Sep 2 at 9:08
  • Same error when I do the command php bin/magento setup:upgrade, actually this post is a shortcut of the method command-line update of the tutorial I am following – SylwekFr Sep 2 at 9:20
  • 1
    Is your "composer update" process was perfectly finished? – Sumit Sep 2 at 9:23
  • @Sumit their is an error I didn't seen in update I will check it, thank you – SylwekFr Sep 2 at 9:29
  • 1
    This is the reason why the "bin/magento setup:upgrade" command gives you the error. Please share your composer.json file here to debug it further. – Sumit Sep 2 at 9:46
2

I've updated your composer.json file as some main content of the files were missing. You can compare both the files and check the difference.

Now follow the below steps to upgrade your Magento from 2.2.X to 2.3.2.

Update your composer.json with the below content.

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.2.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "magento/product-community-edition": "2.3.2",
        "composer/composer": "@alpha",
        "msp/devtools": ">=1.2",
        "magepal/magento2-gmailsmtpapp": ">=1.5",
        "mailchimp/mc-magento2": "^1.0",
        "ebizmarts/magento2-mandrill": "^3.0",
        "mirasvit/module-search-ultimate": "*"
    },
    "require-dev": {
        "phpunit/phpunit": "~6.2.0",
        "squizlabs/php_codesniffer": "3.2.2",
        "phpmd/phpmd": "@stable",
        "pdepend/pdepend": "2.5.2",
        "friendsofphp/php-cs-fixer": "~2.10.1",
        "lusitanian/oauth": "~0.8.10",
        "sebastian/phpcpd": "~3.0.0"
    },
    "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/"
        },
        "psr-0": {
            "": [
                "app/code/"
            ]
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ],
        "exclude-from-classmap": [
            "**/dev/**",
            "**/update/**",
            "**/Test/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "minimum-stability": "stable",
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://repo.magento.com/"
        },
        "amasty": {
            "type": "composer",
            "url": "https://composer.amasty.com/community/"
        },
        "mirasvit-ssu2": {
            "type": "composer",
            "url": "https://27584:4NW7YLV1DJ@packages.mirasvit.com/"
        }
    },
    "extra": {
        "magento-force": "override"
    }
}

Remove contents from pub/static/* generated/* and var/* folder.

Run below commands to upgrade your Magento version.

composer update
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento cache:flush

I hope it'll fix your issue!!!

  • Unfortunately is not, I have I really long message error after bin/magento setup:upgrade which was permission error, then I just chmod -R 777 and I have 3 SQL error – SylwekFr Sep 2 at 10:18
  • You've updated your composer.json file and run composer update command? – Sumit Sep 2 at 10:19
  • Yes first I do composer.phar update – SylwekFr Sep 2 at 10:22
  • You need to update your composer.json file available on the Magento root. – Sumit Sep 2 at 10:22
  • Yes this I did before, I copy the content of your composer.json instead of my composer.json, then I did composer.phar update, then I did php bin/magento setup:upgrade I had lot of permission error, then I did chmodd -R 777 on my document en then I have 3 time this error : SQLSTATE[HY000] [2002] Network is unreachable – SylwekFr Sep 2 at 10:25
0

Backup your composer.json to easily revert your upgrade in case the upgrade fails and you want to revert your upgrade.

$ cp composer.json composer.json.bak

Enable maintenance mode, so that your update will not be able to be interrupted.

$ bin/magento maintenance:enable

First, you need to remove unused packages from your composer.json (--no-update is required here, as you are not going to install it yet, just to tell composer that you want to add and/or remove these packages to composer.json).

$ composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update
$ composer remove composer/composer magento/product-community-edition --no-update

Add the version 2.3.2 of magento-product-community-edition package to your composer.json (--no-update is required here):

$ composer require magento/product-community-edition=2.3.2 --no-update

Add additional packages required by Magento 2.3.2 (still, --no-update is required here):

$ composer require --dev allure-framework/allure-phpunit:~1.2.0 friendsofphp/php-cs-fixer:~2.13.0 lusitanian/oauth:~0.8.10 magento/magento-coding-standard:~1.0.0 magento/magento2-functional-testing-framework:~2.3.14 pdepend/pdepend:2.5.2 phpunit/phpunit:~6.5.0 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:3.3.1 phpunit/phpunit:~6.5.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.3.1 --sort-packages --no-update

Modify your composer.json's autoload section to look like this:

....
"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/"
    },
    "psr-0": {
        "": [
            "app/code/",
            "generated/code/"
        ]
    },
},
....

If you have the Magento updater <root_project>/update (basically this updater is included), you also have to update it. These command will backup your old updater and install the updated one.

$ composer create-project --repository=https://repo.magento.com magento/project-community-edition=2.3.2 update.tmp --no-install
$ mv update update.bak
$ mv update.tmp/update update
$ rm -rf update.tmp

Finally, install the update.

$ composer update

Clear caches and generated content.

$ rm -rf var/cache/* var/page_cache/* generated/code/*

Update the database schema and data.

$ bin/magento setup:upgrade

Disable maintenance mode.

$ bin/magento maintenance:disable

Restart varnish (if you use one).

$ sudo service varnish restart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.