Copied to clipboard

Flag this post as spam?

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


  • Mihai Osvat 20 posts 40 karma points
    Jun 27, 2013 @ 09:20
    Mihai Osvat
    0

    Umbraco not working after database shrinking

    Hello,

    We're using Umbraco 6.0.0, and our database grew wild, because of all the versioning stuff, reaching up to 5 GB. I restored it locally on my machine, executed sql scripts to remove all previous versions before 25 June 2013, run some DBCC commands (CHECKDB, CHECKALLOC), then shrinked it (from Management Console). Thus, the database size lowered to 105 MB.

    The problem is that after uploading the database to the server, Umbraco says "No content found", also in the Umbraco backend, I see all my nodes, but not the content (YSOD instead) ... Tried to republish everything, still the same problem.

    Could anyone help me please ?

  • Rich Green 2246 posts 4008 karma points
    Jun 27, 2013 @ 10:07
    Rich Green
    0

    Hi Mihai,

    You could try to bump the web.config to restart the Umbraco site.

    If not, did you back up the database first? If you did I would restore the original DB and use http://our.umbraco.org/projects/website-utilities/unversion or F.A.L.M Housekeeping to remove the duplicate content nodes.

    Also check the log table (though shouldn't be a problem in v6)

    Rich

  • Mihai Osvat 20 posts 40 karma points
    Jun 27, 2013 @ 11:00
    Mihai Osvat
    0

    Thanks Rich, I tried to touch the web.config, but it's of no use ...

    I will try to backup/restore database again, then try the Housekeeping package, hope it will work. Still, after deleting the old versions, the database will still remain large (the .ldf file will grow) ...

  • Rich Green 2246 posts 4008 karma points
    Jun 27, 2013 @ 11:36
    Rich Green
    0

    Shrinking the database shouldn't cause Umbraco to fail, so I'm not sure if when you manually deleted old versions something got broke?

  • Mihai Osvat 20 posts 40 karma points
    Jun 27, 2013 @ 12:01
    Mihai Osvat
    0

    Rich, this is the script I found on the internet

    DECLARE @createdDate Datetime = '2013-06-01'
    DELETE FROM cmsPropertyData WHERE
        versionId NOT IN (SELECT versionId FROM cmsDocument WHERE updateDate > @createdDate OR published = 1 OR newest = 1) AND
        contentNodeId IN (SELECT DISTINCT nodeID FROM cmsDocument)
    DELETE FROM cmsPreviewXml WHERE
        versionId NOT IN (SELECT versionId FROM cmsDocument WHERE updateDate > @createdDate OR published = 1 OR newest = 1) AND
        nodeId IN (SELECT DISTINCT nodeID FROM cmsDocument)
    DELETE FROM cmsContentVersion WHERE
        versionId NOT IN (SELECT versionId FROM cmsDocument WHERE updateDate > @createdDate OR published = 1 OR newest = 1) AND
        ContentId  IN (SELECT DISTINCT nodeID FROM cmsDocument)
    DELETE FROM cmsDocument WHERE
        versionId NOT IN (SELECT versionId FROM cmsDocument WHERE updateDate > @createdDate OR published = 1 OR newest = 1) AND
        nodeId IN (SELECT DISTINCT nodeID FROM cmsDocument)

    This runs for about 40 minutes, and for me, it deleted more than 3 milion rows ...

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Jun 27, 2013 @ 12:01
    Dave Woestenborghs
    0

    I also think the script to remove your versions is the reason it broke. Umbraco needs at least 2 version kept to be able to work.

    I would recommend to install the unversion package so you keep only x number of versions of your content. Than you can schedule a shrink on your database.

  • Mihai Osvat 20 posts 40 karma points
    Jun 27, 2013 @ 12:05
    Mihai Osvat
    0

    Thanks for your reply, I did install the unversion package, but this works on a node-base strategy, it will remove all the versions of one node, as soon as you publish the node.

    I wanted a quick clean of all the previous versions of all nodes. I think that the Housekeeping package could do the job, but I need to backup/restore again this database first ... so more than 1 hour ...

  • Mihai Osvat 20 posts 40 karma points
    Jun 27, 2013 @ 13:20
    Mihai Osvat
    0

    Now I also installed the F.A.R.M. Housekeeper, I managed to get it working on ver.6, but when I want to clear versions, it throws the error "The operation timed out". I added Connection Timeout in the connection string, also an executionTimeout in the, still the same error ...

    Added this problem on the package site too.

  • Mihai Osvat 20 posts 40 karma points
    Jun 28, 2013 @ 16:07
    Mihai Osvat
    0

    Hi,

    I finnaly realized after several tries, that the database was not restored correctly on my local machine (?!), I restored it from a .bacpac file (the original database is on Windows Azure). When I got it running, everything worked OK (also those scripts are ok ...). Now the size is under 200 MB, which is astonishing.

    I wanna thank everyone for the answers.

Please Sign in or register to post replies

Write your reply to:

Draft