After upgrading from Drupal v9.1.7 to v9.2.0, on a lot of nodes the custom layout builder override layouts were reset to the default layout, resulting in a massive data loss. To make things worse, this only happened on live and not on stage, and was only noticed a few days later. I don't know what has caused the issue, the customer is pretty upset, and I quickly and selectively need to restore the override layouts from a DB snapshot the night before the update (and leave the rest of the data untouched).
So far I know two things:
- All affected nodes have a
node.changedtimestamp matching the time of the update deployment.
- On all affected nodes
node__layout_builder_layouthas been trimmed to one section (same as the default, non-override layout)
- On all affected nodes only the last revision is lost, without generating a new revision id.
- The override layouts usually consist of custom, non-reuseable
block_contentblocks. All the blocks still seem to exist in the DB.
I'd like to know:
- How can I check if a node has an override layout, or is using the default layout of the layout builder (if possible with a plain SQL query, without PHP)
- What else do I need to restore except the
node__layout_builder_layouttable (assuming custom content blocks used by the override layouts still seem to exist) to restore a node's override layout
- Can I savely use SQL
where a <> bor SQL
where a = bwith
bbeing the blob content of