无法通过作曲家从2.2.6升级到2.3


9

我有一个干净的Magento 2.2.6,其中包含使用Composer安装的示例数据。

我正在尝试将其更新为Magento 2.3,因此请按照Magento团队在此处概述的步骤进行操作。

运行后,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
    - 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].

Answers:


8

首先,请确保您正在运行PHP 7.1或7.2

更新您的作曲家

运行这些命令:

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

指定作曲家的其他软件包

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

删除未使用的软件包

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

更新自动加载

打开composer.json并编辑该"autoload": "psr-4"部分以包括"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/"

应用更新

composer update

清除缓存和生成的内容

rm -rf <Magento install dir>/var/cache/*
rm -rf <Magento install dir>/var/page_cache/*
rm -rf <Magento install dir>/generated/code/*

更新数据库架构和数据

php bin/magento setup:upgrade

禁用维护模式

php bin/magento maintenance:disable

如果出现服务器错误托盘以部署静态内容,请清除缓存,重新索引。

就这样,

您可以在此处查看完整的说明

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


没有附加值。您只是复制了Magento文档的粘贴内容
Haim,

您刚刚救了我的命,在控制台上遇到了依赖问题:symfony / dependency-injection v2.5.7与symfony / console冲突[v4.1.0-BETA1]。非常感谢!
Char)

我在多个线程上看到的最完整的答案非常适合我的问题,谢谢!
戴维(David)

解释清楚的答案。感谢您的好帖子@CDzWebDev。
Mohit Kumar Arora

1

问题是样本数据-如果您安装了样本数据,请先运行 php bin/magento sampledata:remove

感谢Alan Storm!



1

将Magento更新到2.3.0版本后,您仍然可以安装示例数据。

因此,更新过程如下所示:

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
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.