How to Upgrade magento version from 2.2.X to 2.3.0?

I think you are skipping some steps. Make sure you are specifying additional packages required :

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

and remove unused packages :

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

You are getting the error mainly because of the fabpot/php-cs-fixer

Also, make sure you read Magento docs

https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html

Hope this helps.


Here are the steps to upgrade Magento 2.2.x to 2.3.0

Step 1: Backup code and database

Step 2:

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

Step 3:

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 4:

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

Step 5: open composer.json file and add this "Zend\Mvc\Controller\": "setup/src/Zend/Mvc/Controller/", around line 47 under psr-4 section.

Step 6:

composer update

Here is the detailed article.


Here are the steps I used to successfully update Magento 2.2.6 to 2.3.0. I have divided the steps into two parts:

Part 1:

  • php bin/magento deploy:mode:set developer
  • php bin/magento cache:disable
  • php bin/magento maintenance:enable
  • composer require magento/product-community-edition 2.3.0 --no-update
  • composer update

POSSIBLE ERROR: You might get the following error: Can only install one of: symfony/console[v4.1.0, v3.4.9]. - magento/magento2-base 2.3.0 requires symfony/console ~4.1.0 -> satisfiable by symfony/console[v4.1.0, v4.1.1, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9]. - Conclusion: don't install sebastian/phpcpd 2.0.4|don't install symfony/console v4.1.1|install symfony/console v2.8.38 - Installation request for sebastian/phpcpd 2.0.4 -> satisfiable by sebastian/phpcpd[2.0.4].

GOTO PART 2 FOR SOLUTION

Part 2:

  • composer config preferred-install dist
  • composer config sort-packages true
  • composer config prefer-stable true
  • composer require --dev friendsofphp/php-cs-fixer:~2.10.0 --no-update
  • composer require --dev sebastian/phpcpd:~3.0.0 --no-update
  • php -r '$autoload=json_decode(file_get_contents("composer.json"), true); $autoload["autoload"]["psr-4"]["Zend\Mvc\Controller\"]= "setup/src/Zend/Mvc/Controller/"; file_put_contents("composer.json", json_encode($autoload, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));'
  • composer update
  • rm -rf var/cache/* var/page_cache/* var/generation/*
  • php bin/magento setup:upgrade
  • php bin/magento setup:di:compile
  • php bin/magento cache:enable
  • php bin/magento maintenance:disable
  • php bin/magento indexer:reindex && php bin/magento cache:clean && php bin/magento cache:flush

Now, Magento 2.2.6 should have been SUCCESSFULLY UPGRADED to MAGENTO 2.3.0

Tags:

Magento2.3.0