Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Oct 12, 2011 @ 02:41
    Tom
    0

    Manually Emptying Recycle Bin

    Hi All,

    having some serious time out issues emptying from recycle bin (i.e. it is taking a production site down trying to empty over 600 nodes)

     

    is there a manual way of nuking the recycle bin via sql?

    Cheers,

    Tom

  • Rik Helsen 670 posts 873 karma points
    Oct 12, 2011 @ 11:15
  • Rik Helsen 670 posts 873 karma points
    Oct 12, 2011 @ 11:16
  • Mike Chambers 636 posts 1253 karma points c-trib
    Oct 12, 2011 @ 14:31
    Mike Chambers
    1

    delete from cmsPreviewXml where nodeId in (select id from umbracoNode where trashed = '1')
    delete from cmsContentVersion where contentId in (select id from umbracoNode where trashed = '1')
    delete from cmsDocument where nodeId in (select id from umbracoNode where trashed = '1')
    delete from cmsContentXML where nodeId in (select id from umbracoNode where trashed = '1')
    delete from cmsContent where nodeId in (select id from umbracoNode where trashed = '1')
    delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where trashed = '1')
    delete from umbracoNode where trashed = '1'

     

    Is my script of choice...

  • Tom 713 posts 954 karma points
    Oct 12, 2011 @ 23:11
    Tom
    0

    Thanks all!

    I cleaned it up using the -20 checks but unfortunately now when i add then try and remove items from my recycle bin I'm getting an error back from the post to the webservice.. will try and look at the umbraco source as this is driving me nuts!

     

    Emptying the recycle bin on a production site took it down yesterday! :.(

  • Tom 713 posts 954 karma points
    Oct 12, 2011 @ 23:21
    Tom
    0

    Now when i try and delete an element from the recycle bin when debugging:

     public static void Delete(string NodeType, int NodeId, string Text)

            {

                // Load task settings

                XmlDocument createDef = GetXmlDoc();

     

                // Create an instance of the type by loading it from the assembly

                XmlNode def = createDef.SelectSingleNode("//nodeType [@alias = '" + NodeType + "']");

                string taskAssembly = def.SelectSingleNode("./tasks/delete").Attributes.GetNamedItem("assembly").Value;

                string taskType = def.SelectSingleNode("./tasks/delete").Attributes.GetNamedItem("type").Value;

     

                Assembly assembly = Assembly.LoadFrom(System.Web.HttpContext.Current.Server.MapPath(GlobalSettings.Path + "/../bin/" + taskAssembly + ".dll"));

                Type type = assembly.GetType(taskAssembly + "." + taskType);

                interfaces.ITask typeInstance = Activator.CreateInstance(type) as interfaces.ITask;

                if (typeInstance != null)

                {

                    typeInstance.ParentID = NodeId;

                    typeInstance.Alias = Text;

                    typeInstance.Delete();

                }

            }

     

    the XmlNode def is null for the node type "contentRecycleBin" when there is clearly some content still in the bin im trying to delete!

    Any help would be most appreciated.

    Thanks,

    Tom

  • Tom 713 posts 954 karma points
    Oct 12, 2011 @ 23:32
    Tom
    0

    For some reason my UI.xml file does not contain:

    <nodeType alias="contentRecycleBin">

        <header>Page</header>

        <usercontrol>/create/content.ascx</usercontrol>

        <tasks>

          <delete assembly="umbraco" type="contentTasks" />

        </tasks>

      </nodeType>

     

    would there be ANY reason why that would have been nuked? very confusing?!

  • Tom 713 posts 954 karma points
    Oct 12, 2011 @ 23:35
    Tom
    0

    the version of umbraco we're running is a modded version of 4.0.4.1 (i would LOVE to upgrade it believe me! but we need to wait for some stuff in core!)

  • 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