TYPO3 Database migration from fluidcontent to flux
Asked Answered
J

4

5

I want to switch from fluidcontent to flux by removing the obsolete fluidcontent. As mentioned in here https://github.com/FluidTYPO3/fluidcontent/issues/424,

you have to change the CType for all fluidcontent objects in the tt_content table from fluidcontent_content to extensionnamewithoutunderscores_templatenamewithoutunderscores. Is there a migration script or a SQL statement available for this?

The tablename without Undescores is the filename. Why and where do i need the id of the flux:form?

Jesse answered 8/6, 2018 at 7:2 Comment(0)
J
13

A colleague made a SQL statement, which converts all fluidcontent CTypes to the correct flux value:

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

You only have to change YourNamespace.YourExtension. You can find the right wording for YourNamespace.YourExtension in the tx_fed_fcefile row.

For some reasons i had to replace the CType to flux_templatenamewithoutunderscores not to extensionnamewithoutunderscores_templatenamewithoutunderscores

Jesse answered 8/6, 2018 at 11:13 Comment(3)
maybe your own extension was created but not installed?Birkner
The flux_* causes the use of the master branch of the flux extension. In the development branch, it is yourextension_*. github.com/FluidTYPO3/flux/issues/1542Jesse
flux 9.1.0+ uses yourextension_ as prefix.Overwind
T
4

As said in the linked page:
You will need some (one for each CE you defined) queries like

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

you might need a list of used CEs (with count and ignoring deleted and hidden):

SELECT tx_fed_fcefile,count(*) 
  FROM tt_content
  WHERE CType = 'fluidcontent_content'
  GROUP BY tx_fed_fcefile
Typewriting answered 8/6, 2018 at 7:38 Comment(3)
This is going in the right direction, thanks. But i would love to have an automated statement/script, so i do not have to check agains all CEs.Jesse
so the neccessary string functions are available in SQL it would be easier to do it in PHP: you need to split the string in the field `tx_fed_fcefile', lowercase it, remove underscores and concatenate again. But writing either PHP or even SQL might take longer than executing some queries by hand in the SQL console (of a GUI where you can edit the last query). (list available in edited answer)Antacid
See also #55184181Sextans
Z
2

@kimomat's query is actually really good. I just added in some spice in case you have more than one provider extensions installed/used.

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%';
  • Run the query for each provider extension.
  • What to use for YourNamespace.YourExtension can also be gotten from the ext_localconf.php file of your provider extension.
  • For example if my extension's name/key is my_provider, then extensionnamewithoutunderscores_ will be myprovider_

A complete working article on how to do this fluidcontent to flux migration can be found here. https://sigalambigha.home.blog/2020/04/29/how-to-migrate-fluidcontent-to-flux/

Zygosis answered 19/7, 2020 at 17:8 Comment(0)
S
1

This isn't a unique answer, but it may be helpful for you all to have a specific application what it looks like for a particular situation. In this case it is an upgrade of Flux and other extensions on a site using fluidbootstraptheme.

First check what needs to be updated.

I ran this SQL in PhpMyAdmin

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

For my particular website this resulted in...

enter image description here

Make needed database updates

Now run these SQL statements in the database to fix each of the things that need updating...

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'

If updating to Flux > 6 don't forget to run Flux upgrade script

After updating doing the SQL updates mentioned above, some of the content still wasn't showing up in the ThreeColumns and other fluidbootstraptheme content elements that had nested content. So I went to the extension in the backend and ran the update script in flux and it seemed to fix it... the results were

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
Sextans answered 4/10, 2020 at 17:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.