Copied to clipboard

Flag this post as spam?

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


  • Fergus Davidson 309 posts 588 karma points
    Apr 26, 2017 @ 12:35
    Fergus Davidson
    0

    Best way to detatch properties from compositions

    Hi

    i have a site in 7.5.11 which is already filled with content.

    Recent changes in scope and requirement means that i need to make some changes to the Document Types, removing some properties and adding others.

    Some of the properties to remove are currently in compoistions and i cannot just delete them as i need a lot of the data to remain in the parent Dcument Type.

    QUESTION: is there a way to detach a property from a composition and attach it to its parent doctype without losing data?

    at the moment, i am thinking i may have to add a new property of the same type, copy the data to the new property, delete the original, rename the new property. Is there anything simpler?

    many thanks

  • David Peck 687 posts 1863 karma points c-trib
    Apr 26, 2017 @ 13:20
    David Peck
    0

    You could do this programmatically, just creating the new property and then using the API copy all the data over. I don't think there is another way.

    The only other thought is that if you don't HAVE to remove the old property then you could use the new field but default to the old one. A few ways of achieving that but this is the simpliest.

    @Umbraco.Coalesce(newField, oldField)
    
  • David Peck 687 posts 1863 karma points c-trib
    Apr 26, 2017 @ 13:22
    David Peck
    0

    It might also be worth checking out: https://soetemansoftware.nl/bulkmanager and https://soetemansoftware.nl/cmsimport

    Both have potential to do as needed

  • Fergus Davidson 309 posts 588 karma points
    Apr 26, 2017 @ 13:31
    Fergus Davidson
    1

    Thanks David! - I like the coalesce idea, but that does mean I have to go through and edit all my views.

    I am not really a .NET guy, so the API route not the best way for me.

    Great shout on CMS Import - we have a license for the site - didn't even occur to me.

    Right - that's my weekend sorted.

    thanks Again

  • David Peck 687 posts 1863 karma points c-trib
    Apr 26, 2017 @ 15:10
    David Peck
    0

    You would need to edit all your views I'm afraid. Have a good weekend 👅.

Please Sign in or register to post replies

Write your reply to:

Draft