Rename node type entries in the database

Hello,

I want to rename my NodeType Vendor.Site:OldNodeTypeName to Vendor.Site:NewNodeTypeName.

The task is as straight-forward as it can get in the yaml file, I can just rename it and I’m done. The actual problem I face is that after renaming my NodeType, I want to apply the new name to the existing entries in the database.

I know I could run ./flow node:repair and they would be deleted, but I don’t want to lose my content. Is there an easy solution to this ?

Is the query below enough to handle this, or do I have to do something else ?

UPDATE neos_contentrepository_domain_model_nodedata SET nodetype='Vendor.Site:NewNodeTypeName' WHERE nodetype LIKE 'Vendor.Site:OldNodeTypeName'

You can use a database migration in the same way the Nodetypes package did, when the namespace was changed from TYPO3 to Neos

Nice, thanks for the reference !

Using doctrine migrations to fiddle with (internal!) tables by the Neos core can be quite dangerous, or at least might stop working at some point.
Better use Node Migrations (Reference: http://neos.readthedocs.io/en/stable/References/NodeMigrations.html)

1 Like

Hmmm, this is weird Migrations/TYPO3CR is seen in the CLI, but Migrations/ContentRepository is not.

What Neos version are you using? As far I know, the ContentRepository folder name is for future use

I’m using 3.2.
Hmmm, alright, then I guess someone rushed to update the documentation with it I guess