【问题标题】:Update Typo3 9.5 with Composer使用 Composer 更新 Typo3 9.5
【发布时间】:2021-07-21 08:35:48
【问题描述】:

我应该从我的客户那里更新一个typo3 v9.5 网站。在我接触现场系统之前,我想用演示站点进行试运行,所以我启动了一个干净的 9.5 站点运行

composer create-project typo3/cms-base-distribution:^9.5 .

在那之后,我做了typo3 网络安装的东西并让网站正常工作。我现在想要实现的是将网站更新到至少 10.4。我一开始运行了数据库分析器,它告诉我一切都很好,正如你在这里看到的那样。

之后我运行了升级向导。它告诉我它必须更改数据库排序规则,因为它是 utf_8_general_ci。但没有其他事情要做。

在那之后我去了composer update --with-dependencies,这告诉我没有什么可以安装、更新或删除的。在这一点上我有点困惑,因为系统没有显示出重大更新的机会。在尝试了一些事情之后,我去更新 composer.json 本身并将其替换为来自一个干净的 10.4 版本的 composer.json,看起来像这样:

{
    "repositories": [
        { "type": "composer", "url": "https://composer.typo3.org/" }
    ],
    "name": "typo3/cms-base-distribution",
    "description" : "TYPO3 CMS Base Distribution",
    "license": "GPL-2.0-or-later",
    "config": {
        "platform": {
            "php": "7.2"
        }
    },
    "require": {
        "helhum/typo3-console": "^6.0.0@beta",
        "typo3/cms-about": "^10.4",
        "typo3/cms-backend": "^10.4",
        "typo3/cms-belog": "^10.4",
        "typo3/cms-beuser": "^10.4",
        "typo3/cms-core": "^10.4",
        "typo3/cms-dashboard": "^10.4",
        "typo3/cms-extbase": "^10.4",
        "typo3/cms-extensionmanager": "^10.4",
        "typo3/cms-felogin": "^10.4",
        "typo3/cms-filelist": "^10.4",
        "typo3/cms-fluid": "^10.4",
        "typo3/cms-fluid-styled-content": "^10.4",
        "typo3/cms-form": "^10.4",
        "typo3/cms-frontend": "^10.4",
        "typo3/cms-impexp": "^10.4",
        "typo3/cms-info": "^10.4",
        "typo3/cms-install": "^10.4",
        "typo3/cms-recordlist": "^10.4",
        "typo3/cms-rte-ckeditor": "^10.4",
        "typo3/cms-seo": "^10.4",
        "typo3/cms-setup": "^10.4",
        "typo3/cms-sys-note": "^10.4",
        "typo3/cms-t3editor": "^10.4",
        "typo3/cms-tstemplate": "^10.4",
        "typo3/cms-viewpage": "^10.4"
        
    },
    "scripts":{
        "typo3-cms-scripts": [
            "typo3cms install:fixfolderstructure",
            "typo3cms install:generatepackagestates"
        ],
        "post-autoload-dump": [
            "@typo3-cms-scripts"
        ]
    }
}

在运行另一个composer update 后,更新本身得到了更新,但是数据库没有得到更新,导致我由于缺少表而无法登录。我显然没有正确更新网站,现在我做错了什么?我尝试按照官方的typo3文档进行操作。

Oops, an error occurred! An exception occurred while executing 'SELECT content FROM cache_hash WHERE (identifier = ?) AND (expires >= ?)' with params ["d07b003d9fce07cd551ada22027bf881", 1626341203]: Table 'complan4.cache_hash' doesn't exist

composer.json 之前的样子:

{
    "repositories": [
        { "type": "composer", "url": "https://composer.typo3.org/" }
    ],
    "name": "typo3/cms-base-distribution",
    "description" : "TYPO3 CMS Base Distribution",
    "license": "GPL-2.0-or-later",
    "config": {
        "platform": {
            "php": "7.2"
        }
    },
    "require": {
        "helhum/typo3-console": "^5.5.5",
        "typo3/minimal": "^9.5",
        "typo3/cms-about": "^9.5",
        "typo3/cms-adminpanel": "^9.5",
        "typo3/cms-belog": "^9.5",
        "typo3/cms-beuser": "^9.5",
        "typo3/cms-felogin": "^9.5",
        "typo3/cms-fluid-styled-content": "^9.5",
        "typo3/cms-form": "^9.5",
        "typo3/cms-impexp": "^9.5",
        "typo3/cms-info": "^9.5",
        "typo3/cms-redirects": "^9.5",
        "typo3/cms-reports": "^9.5",
        "typo3/cms-rte-ckeditor": "^9.5",
        "typo3/cms-setup": "^9.5",
        "typo3/cms-seo": "^9.5",
        "typo3/cms-sys-note": "^9.5",
        "typo3/cms-t3editor": "^9.5",
        "typo3/cms-tstemplate": "^9.5",
        "typo3/cms-viewpage": "^9.5"
    },
    "scripts":{
        "typo3-cms-scripts": [
            "typo3cms install:fixfolderstructure",
            "typo3cms install:generatepackagestates"
        ],
        "post-autoload-dump": [
            "@typo3-cms-scripts"
        ]
    }
}

【问题讨论】:

  • composer update 没有产生要更新的包时,composer.json 的外观如何?
  • .....好吧,如果您的配置要求安装"typo3/minimal": "^9.5",这不是很明显不会安装v10吗?
  • 是的,我知道,但就像我说的,我尝试安装 9.5 版本,然后将其升级到 10.4。不知道为什么最小的包应该是一个问题
  • 您是如何尝试更新到 v10 的?没有将composer.json 中的版本约束编辑为允许安装 v10 软件包的任何内容?
  • 就像我写的那样,我只是将 composer.json 从 9.5 版本换成 10.4 版本之一

标签: composer-php typo3 typo3-9.x typo3-extensions typo3-10.x


【解决方案1】:

运行 composer update 后,您无法再登录完整的后端,但您仍然可以登录包含必要升级和维护模块的安装工具。

只需使用https://your.domain.tld/typo3/install.php

并使用给定的安装工具密码登录,如果您刚刚进行了快速而肮脏的默认安装,则该密码应与管理员密码相同。

然后您可以运行所有必要的数据库更新和升级向导。

如果您仍然遇到问题,您可能需要考虑预订专业的升级服务。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-24
    • 2020-06-18
    • 2021-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-19
    相关资源
    最近更新 更多