Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lee 35 posts 84 karma points
    Dec 22, 2019 @ 20:58
    Lee
    0

    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?

  • Marc Goodson 2157 posts 14435 karma points MVP 9x c-trib
    Dec 23, 2019 @ 20:04
    Marc Goodson
    1

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies