At our web agency, we carried out an update from TYPO3 v8 to TYPO3 v9. The template used was based on the TYPO3 extension gridelements. After the update, however, some elements in the frontend were incorrectly positioned and styled. The same "mess" was visible in the website backend: the child elements had left their parent elements and were scattered around in the wrong order. The reason for this is that the colPos field in the tt_content table is modified during the core update. See also the GridElements documentation:
It states:
Important note about the colPos field!
The colPos field of the tt_content table will be changed from unsigned int(3) to smallint(6) to enable the usage of negative values. This should never be reverted by any upgrade script later on! Otherwise any child element will be moved from it’s parent container to the default page column. Some people ran into problems during automatic upgrades done by their providers. So be sure to make a backup of your content before upgrading!
In other words, we need to back up the colPos column from the old database and then restore it in the new database using UPDATE statements. First, we read out the colPos column with the following command:
SELECT CONCAT('UPDATE tt_content set colPos=',colPos,' where uid=',uid,' limit 1;') FROM tt_content ORDER BY uid;
(Thanks to Blue Side's article on GridElements updates.)
We then have a set of convenient MySQL UPDATE statements for each element and can use them to update the new tt_content table. The original hierarchies are restored as a result.
Encountered at our web agency on a website running TYPO3 9.5.19.
