TYPO3数据库从fluidcontent迁移到flux

5

我想通过移除过时的fluidcontent来从fluidcontent切换到flux。 如此处所述https://github.com/FluidTYPO3/fluidcontent/issues/424

您需要将tt_content表中所有fluidcontent对象的CType从fluidcontent_content更改为extensionnamewithoutunderscores_templatenamewithoutunderscores。 是否有可用于此的迁移脚本或SQL语句?

没有下划线的表名是文件名。 我为什么需要flux:form的id以及在哪里需要它?

4个回答

13

一个同事写了一条SQL语句,将所有fluidcontent的CTypes转换为正确的flux值:

UPDATE tt_content 
 SET CType = LOWER(REPLACE(REPLACE(tx_fed_fcefile, 'YourNamespace.YourExtension:', 'flux_'), '.html', ''))
 WHERE CType = 'fluidcontent_content';

您只需要更改YourNamespace.YourExtension。您可以在tx_fed_fcefile行中找到适当的YourNamespace.YourExtension文本。

出于某些原因,我不得不将CType替换为flux_templatenamewithoutunderscores而不是extensionnamewithoutunderscores_templatenamewithoutunderscores


也许您创建了自己的扩展,但没有安装? - David
1
flux_*会导致使用flux扩展的主分支。在开发分支中,它是yourextension_*。https://github.com/FluidTYPO3/flux/issues/1542 - kimomat
Flux 9.1.0+使用yourextension_作为前缀。 - cweiske

4

如链接页面所述:
您需要一些查询(每个定义的CE一个):

UPDATE tt_content
    SET CType = 'myextension_button'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'Vendor.MyExtension:Button.html'

您可能需要一个使用的CE列表(包括计数,并忽略已删除和隐藏的):
SELECT tx_fed_fcefile,count(*) 
  FROM tt_content
  WHERE CType = 'fluidcontent_content'
  GROUP BY tx_fed_fcefile

这个方向是正确的,谢谢。但我希望有一个自动化的语句/脚本,这样我就不必再检查所有CEs了。 - kimomat
为了在SQL中使用必要的字符串函数,用PHP做会更容易:你需要将字段tx_fed_fcefile中的字符串拆分、转换为小写、去掉下划线并重新连接。但是编写PHP甚至SQL可能比在SQL控制台手动执行一些查询更耗时(在GUI中可以编辑最后一个查询)。 (列表在编辑的答案中提供) - Bernd Wilke πφ
请参见 https://stackoverflow.com/questions/55183681/typo3-database-migration-from-fluidcontent-to-flux-goes-wrong - god_is_love

2

@kimomat的查询实际上非常好。 我只是加了一些调味料,以防您安装/使用多个提供程序扩展。

UPDATE tt_content 
 SET CType = LOWER(REPLACE(REPLACE(tx_fed_fcefile, 'YourNamespace.YourExtension:', 'extensionnamewithoutunderscores_'), '.html', ''))
 WHERE CType = 'fluidcontent_content' AND `tx_fed_fcefile` LIKE 'YourNamespace.YourExtension%';
  • 对每个提供者扩展运行查询。
  • 要使用的YourNamespace.YourExtension也可以从提供者扩展的ext_localconf.php文件中获取。
  • 例如,如果我的扩展名/关键字是my_provider,那么extensionnamewithoutunderscores_将为myprovider_

有关如何进行此fluidcontent到flux迁移的完整工作文章可在此处找到。 https://sigalambigha.home.blog/2020/04/29/how-to-migrate-fluidcontent-to-flux/


1
这不是一个独特的答案,但对于您们来说,具体的应用场景可能会有所帮助。在这种情况下,它是针对使用fluidbootstraptheme网站上的Flux和其他扩展的升级。

首先检查需要更新什么。

我在PhpMyAdmin中运行了这个SQL。

SELECT tx_fed_fcefile,count(*) 
  FROM tt_content
  WHERE CType = 'fluidcontent_content'
  GROUP BY tx_fed_fcefile

对于我的特定网站,这导致...

enter image description here

进行必要的数据库更新

现在在数据库中运行这些SQL语句,以修复需要更新的每个问题...

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_button'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:Button.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_carousel'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:Carousel.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_embedvideo'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:EmbedVideo.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_imagegallery'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:ImageGallery.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_modallight'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:ModalLight.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_pageheader'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:PageHeader.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_row'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:Row.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_simpleresponsiveimage'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:SimpleResponsiveImage.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_tabs'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:Tabs.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_threecolumn'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:ThreeColumn.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_thumbnailbox'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:ThumbnailBox.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_twocolumn'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:TwoColumn.html'

UPDATE tt_content
    SET CType = 'fluidbootstraptheme_well'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'FluidBT.Fluidbootstraptheme:Well.html'

UPDATE tt_content
    SET CType = 'netchd_mycontentelement'
    WHERE CType = 'fluidcontent_content'
      AND tx_fed_fcefile = 'rapidfyre_netchd:MyContentElement.html'

如果升级到Flux > 6,请不要忘记运行Flux升级脚本

在完成上述SQL更新后,一些嵌套内容的ThreeColumns和其他fluidbootstraptheme内容元素仍未显示。因此,我进入后端的扩展程序并运行了Flux的升级脚本,似乎修复了它...结果如下:

tt_content:713 on page 1 has new colPos 27502
tt_content:599 on page 1 has new colPos 27502
tt_content:612 on page 1 has new colPos 27502
tt_content:167 on page 38 has new colPos 22001
tt_content:168 on page 38 has new colPos 22002
tt_content:169 on page 38 has new colPos 22002
tt_content:417 on page 1 has new colPos 41500
tt_content:276 on page 1 has new colPos 27503
tt_content:264 on page 1 has new colPos 27502
tt_content:277 on page 166 has new colPos 28501
tt_content:286 on page 166 has new colPos 28502
tt_content:288 on page 166 has new colPos 28502
tt_content:289 on page 166 has new colPos 28502
tt_content:294 on page 173 has new colPos 32701
tt_content:328 on page 173 has new colPos 32701
tt_content:330 on page 1 has new colPos 27501
tt_content:300 on page 166 has new colPos 28502
tt_content:313 on page 17 has new colPos 31201
tt_content:314 on page 17 has new colPos 31202
tt_content:315 on page 17 has new colPos 31203
tt_content:326 on page 1 has new colPos 27501
tt_content:329 on page 173 has new colPos 32702
tt_content:341 on page 1 has new colPos 27503
tt_content:333 on page 173 has new colPos 32702
tt_content:337 on page 186 has new colPos 33602
tt_content:334 on page 186 has new colPos 33601
tt_content:338 on page 186 has new colPos 33602
tt_content:339 on page 186 has new colPos 33602
tt_content:354 on page 1 has new colPos 27502
tt_content:358 on page 1 has new colPos 27503
tt_content:387 on page 1 has new colPos 27503
tt_content:360 on page 1 has new colPos 27503
tt_content:388 on page 1 has new colPos 27503
tt_content:699 on page 1 has new colPos 27503
tt_content:698 on page 1 has new colPos 27503
tt_content:487 on page 1 has new colPos 27502
tt_content:371 on page 1 has new colPos 27502
tt_content:372 on page 1 has new colPos 27502
tt_content:392 on page 1 has new colPos 27503
tt_content:386 on page 1 has new colPos 27503
tt_content:436 on page 1 has new colPos 27503
tt_content:389 on page 1 has new colPos 27503
tt_content:397 on page 1 has new colPos 27503
tt_content:398 on page 1 has new colPos 27503
tt_content:414 on page 1 has new colPos 41500
tt_content:415 on page 1 has new colPos 27503
tt_content:416 on page 1 has new colPos 41500
tt_content:418 on page 1 has new colPos 41500
tt_content:419 on page 1 has new colPos 41500
tt_content:430 on page 1 has new colPos 41500
tt_content:435 on page 1 has new colPos 27502
tt_content:438 on page 1 has new colPos 27503
tt_content:437 on page 1 has new colPos 27503
tt_content:441 on page 1 has new colPos 27502
tt_content:457 on page 1 has new colPos 27503
tt_content:595 on page 1 has new colPos 27503
tt_content:479 on page 1 has new colPos 27503
tt_content:484 on page 1 has new colPos 27502
tt_content:480 on page 1 has new colPos 27502
tt_content:483 on page 1 has new colPos 27502
tt_content:495 on page 1 has new colPos 27503
tt_content:526 on page 230 has new colPos 52802
tt_content:529 on page 230 has new colPos 52801
tt_content:536 on page 1 has new colPos 27502
tt_content:545 on page 1 has new colPos 27502
tt_content:567 on page 1 has new colPos 27502
tt_content:594 on page 1 has new colPos 27503
tt_content:546 on page 1 has new colPos 27502
tt_content:568 on page 1 has new colPos 27502
tt_content:569 on page 1 has new colPos 27502
tt_content:578 on page 1 has new colPos 27502
tt_content:583 on page 1 has new colPos 27502
tt_content:584 on page 1 has new colPos 27502
tt_content:590 on page 1 has new colPos 27502
tt_content:593 on page 1 has new colPos 27502
tt_content:597 on page 1 has new colPos 27503
tt_content:598 on page 1 has new colPos 27502
tt_content:600 on page 1 has new colPos 27503
tt_content:609 on page 1 has new colPos 27503
tt_content:601 on page 250 has new colPos 60401
tt_content:602 on page 250 has new colPos 60401
tt_content:603 on page 250 has new colPos 60402
tt_content:607 on page 250 has new colPos 60402
tt_content:608 on page 250 has new colPos 60402
tt_content:610 on page 1 has new colPos 27502
tt_content:620 on page 1 has new colPos 27503
tt_content:628 on page 252 has new colPos 62701
tt_content:631 on page 252 has new colPos 62702
tt_content:636 on page 252 has new colPos 62702
tt_content:638 on page 1 has new colPos 27503
tt_content:643 on page 253 has new colPos 64102
tt_content:647 on page 253 has new colPos 64601
tt_content:648 on page 253 has new colPos 64602
tt_content:649 on page 253 has new colPos 64101
tt_content:654 on page 139 has new colPos 65301
tt_content:655 on page 139 has new colPos 65302
tt_content:670 on page 1 has new colPos 27503
tt_content:697 on page 1 has new colPos 27503
tt_content:689 on page 240 has new colPos 68802
tt_content:690 on page 240 has new colPos 68801
tt_content:691 on page 240 has new colPos 68803
tt_content:700 on page 1 has new colPos 27503
tt_content:711 on page 1 has new colPos 27502
tt_content:712 on page 1 has new colPos 27502
tt_content:714 on page 1 has new colPos 27502

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接