Cannot upgrade from 2.2.6 to 2.3 via composer
-
06-02-2021 - |
Вопрос
I have a clean Magento 2.2.6 with sample data that I installed using composer.
I am trying to update it to Magento 2.3 so following the steps outlined here by the Magento team.
After running composer update
I get the following:
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
- magento/module-wishlist-sample-data 100.2.0 requires magento/module-wishlist 101.0.* -> satisfiable by magento/module-wishlist[101.0.4, 101.0.0, 101.0.1, 101.0.2, 101.0.3, 101.0.5].
- magento/module-wishlist-sample-data 100.2.0 requires magento/module-wishlist 101.0.* -> satisfiable by magento/module-wishlist[101.0.4, 101.0.0, 101.0.1, 101.0.2, 101.0.3, 101.0.5].
- Can only install one of: magento/module-wishlist[101.1.0, 101.0.4].
- Can only install one of: magento/module-wishlist[101.1.0, 101.0.0].
- Can only install one of: magento/module-wishlist[101.1.0, 101.0.1].
- Can only install one of: magento/module-wishlist[101.1.0, 101.0.2].
- Can only install one of: magento/module-wishlist[101.1.0, 101.0.3].
- Can only install one of: magento/module-wishlist[101.1.0, 101.0.4].
- Can only install one of: magento/module-wishlist[101.1.0, 101.0.5].
- magento/product-community-edition 2.3.0 requires magento/module-wishlist 101.1.0 -> satisfiable by magento/module-wishlist[101.1.0].
- Installation request for magento/product-community-edition 2.3.0 -> satisfiable by magento/product-community-edition[2.3.0].
- Installation request for magento/module-wishlist-sample-data 100.2.* -> satisfiable by magento/module-wishlist-sample-data[100.2.0].
Решение 2
The issue was the sample data - if you have sample data installed then first run php bin/magento sampledata:remove
Thanks to Alan Storm!
Другие советы
First be sure you are running PHP 7.1 or 7.2
Update your composer
run those commandes:
composer require magento/product-community-edition=2.3.0 --no-update
Specify additional packages for composer Run this
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
Remove unused packages
composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update
Update autoload
Open composer.json
and edit the "autoload": "psr-4"
section to include "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
:
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/",
"Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
Apply updates
composer update
Clear caches and generated content
rm -rf <Magento install dir>/var/cache/*
rm -rf <Magento install dir>/var/page_cache/*
rm -rf <Magento install dir>/generated/code/*
Update the database schema and data
php bin/magento setup:upgrade
Disable maintenance mode
php bin/magento maintenance:disable
Clear the cache, reindex, if you get a server error tray to deploy static content.
and that's all,
You can check the full explanation here
https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html
You can also try the steps in the Magento documentation on the page that is specifically for doing a Command-line upgrade with sample data.
After updating Magento to 2.3.0 version, you still available to install sample data.
So, updating process looks like:
php bin/magento sampledata:remove
composer require magento/product-community-edition=2.3.0 --no-update
composer update
php bin/magento sampledata:deploy
php bin/magento setup:upgrade