Greetings. I have a doc type with a group, which I now realize needs to be a composition; however, I have nearly two hundred nodes that used the group already. Can I convert it somehow? Or do I have to use the API to copy the data from the current doc type to the new composition fields?
Essentially Umbraco stores data for all the properties of a content item against the corresponding PropertyType, and the PropertyType is related to a PropertyTypeGroup and both the PropertyTypeGroup and the PropertyType is related to the ContentType that defines the Property.
Therefore it is possible to Create a New 'Composition' add a new 'Property Type Group' to it, and add this to your existing Document Type - then via SQL move each PropertyType for the properties you want to move from their existing Document Type and onto the new composition - because the new composition is added to the Document Type - and because you use SQL to move, then when you perform an application pool recycle, the data is kept intact.
I don't know another way of achieving the same and the database tables are slightly different in V8 but I think the principle is still the same.
Convert doc type group to composition
Greetings. I have a doc type with a group, which I now realize needs to be a composition; however, I have nearly two hundred nodes that used the group already. Can I convert it somehow? Or do I have to use the API to copy the data from the current doc type to the new composition fields?
Hi Lee
I wrote this blog post a while back for V7, that might be helpful.
http://tooorangey.co.uk/posts/moving-just-keep-moving/
Essentially Umbraco stores data for all the properties of a content item against the corresponding PropertyType, and the PropertyType is related to a PropertyTypeGroup and both the PropertyTypeGroup and the PropertyType is related to the ContentType that defines the Property.
Therefore it is possible to Create a New 'Composition' add a new 'Property Type Group' to it, and add this to your existing Document Type - then via SQL move each PropertyType for the properties you want to move from their existing Document Type and onto the new composition - because the new composition is added to the Document Type - and because you use SQL to move, then when you perform an application pool recycle, the data is kept intact.
I don't know another way of achieving the same and the database tables are slightly different in V8 but I think the principle is still the same.
It' just a bit scary!
regards
Marc
is working on a reply...