简体   繁体   English

TYPO3中的数据库迁移

[英]Database Migration in TYPO3

I've started to refactor the ext:crawler to make it compatible with TYPO3 9LTS. 我已经开始重构ext:crawler以使其与TYPO3 9LTS兼容。

Currently we have a domain model based only on a database table + a TCA configuration: 当前,我们有一个仅基于数据库表+ TCA配置的域模型:

https://github.com/AOEpeople/crawler/blob/master/ext_tables.sql#L48 https://github.com/AOEpeople/crawler/blob/master/Configuration/TCA/tx_crawler_configuration.php https://github.com/AOEpeople/crawler/blob/master/ext_tables.sql#L48 https://github.com/AOEpeople/crawler/blob/master/Configuration/TCA/tx_crawler_configuration.php

I want to add a regular Domain Model and Repository for the Configurations instead, to benefit more from the code from TYPO3 Core. 我想为配置添加常规的域模型和存储库,以从TYPO3 Core的代码中受益更多。

My problem is currently: 我的问题目前是:

I don't know how to migrate data from the already existing table tx_crawler_configuration to the new tx_crawler_domain_model_configuration without the users are loosing any data, or need to do any manual work. 我不知道如何将数据从现有表tx_crawler_configuration到新的tx_crawler_domain_model_configuration而用户不会丢失任何数据,也无需进行任何手动工作。

I haven't found anything on this topic yet. 我还没有找到关于这个话题的任何东西。 I know I can "use foreign data source" but it's not foreign data, so not sure this is the best approach. 我知道我可以“使用外部数据源”,但它不是外部数据,因此不确定这是最佳方法。 https://docs.typo3.org/typo3cms/ExtbaseFluidBook/6-Persistence/4-use-foreign-data-sources.html https://docs.typo3.org/typo3cms/ExtbaseFluidBook/6-Persistence/4-use-foreign-data-sources.html

I appreciate your input, thanks. 感谢您的投入,谢谢。

Torben Hansen just did something similar, when he migrated sf_bannners from using own Category concept to use the sys_category concept of TYPO3 Torben Hansen做了类似的事情,将sf_bannners从使用自己的Category概念迁移到使用TYPO3的sys_category概念

What he does is creating a ext_update.php script that is being called automatically upon installation. 他所做的是创建一个ext_update.php脚本,该脚本在安装时会自动调用。 You can see his commit here 你可以在这里看到他的承诺

https://github.com/derhansen/sf_banners/commit/02c2c6f1729b96940bb4dd0ca29761fe48d28c14 https://github.com/derhansen/sf_banners/commit/02c2c6f1729b96940bb4dd0ca29761fe48d28c14

and probably catch him on Slack with any questions 并可能在任何问题上抓住他

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM