Copied to clipboard

Flag this post as spam?

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


  • Stas 13 posts 63 karma points
    Jun 14, 2016 @ 12:05
    Stas
    0

    What is the right way to delete part of the content tree? (quick way)

    Hi Dear Everyone,

    I have faced with another obstacle on my project - I had to clean up a small part of content tree, here is what behind the scene was called:

    url:POST /umbraco/backoffice/UmbracoApi/Content/DeleteById?id=105518, time:2087641 msec, client:....
    

    as U can see, request executed more then 2K seconds!

    Would U please suggest the right (QUICK) way to delete the part of the content tree using ... whatever?

    P.S. Right now I just pressed DELETE in backoffice on the one of root node. Configuration:

    • Umbraco 7.2.4
    • MS SQL Express
    • 4 Core CPU + 4 GB RAM

    Thanks in advance. Looking forward for any ideas U have ...

  • Dennis Aaen 4457 posts 17970 karma points admin hq c-trib
    Jun 14, 2016 @ 12:46
    Dennis Aaen
    0

    Hi StasN,

    I would recommend you to have a look at the ContentService, which has the method to delete nodes from the content tree.

    https://our.umbraco.org/documentation/reference/management/services/contentservice

    Hope this helps,

    /Dennis

  • Stas 13 posts 63 karma points
    Jun 14, 2016 @ 12:50
    Stas
    0

    Hi Dennis!

    Thanks for your quick idea ...

    I will check it and share my results.

    Only question - do U think "DeleteById" method from UmbracoApi uses something different? While it's internal "special" method ...

    Anyway thanks! I will check it right now...

  • Stas 13 posts 63 karma points
    Jun 14, 2016 @ 14:55
    Stas
    0

    Quick info,

    Unfortunately I can't right now implement code into controller, so I quickly put it into view and tried with Media Content using Services:

    Descendants to delete: 499
    Time: 00:03:04.4835616
    

    Is it good? But - It's obviously better then 33 minutes I got with content from backoffice, but I didn't check the amount of nodes before deleting.

    Decided to restore DB and test it beside original project ... just to close our conversation:

    Descendants to delete: 1667
    Time: 00:07:00.8267001
    

    Thank U!

  • 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