Truncate the ChangeLog



I want to truncate the changelog, but the function "Change Log Auto Truncate" allows only rows older than 30 days to removed from the changelog. So build my own function where I could decide via a dropdown from how many days back in time the changedate for a logentry should be to be removed from the changelog. For example: if I choose "15" from the dropdown rows with a changedate older than 15 days would be removed from the changelog if nothing else, for example mirroring, that where dependent on that rows in the changelog. The code:

IChangeLog changeLog = (IChangeLog)ClassFactory.CreateInstance(typeof(IChangeLog), newobject 0]);

 DateTime oldestChangeDate = DateTime.Now.AddDays(-1*double.Parse(uxNoOfDays.SelectedValue));



I choosed "1"  from the dropdown but to my surprise it caused no changes in the changelog: no rows were removed. Why?

Are there so many rows that has a dependency to pages in EPiServer or what? There are almost 9 million rows in the changelog and about 13000 pages in the site. The site does not use mirroring.



Sep 27, 2012 14:46

Hi Johannes,


I had a simular problem with a site that hadn't turned on changelog truncate and then wanted to. The issue for me was that the sql query timesout because there are so many rows.

So what I did was just to run the sp manualy the first time and then the scheduled work would run as inteded.





Sep 27, 2012 15:46
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.