Does anyone know if there's a way to delete old verions of all pages? Since the default value in EPiServer is "unlimited" some of our pages have over 450 verions. If i set the allowed verions to 100, which is the top limit, it's to much work and the databaseconnection timeout.
There must be a stored procedure or SQL-script to fix this.
You probably just need to increase the query timeout for the database. There are two settings for this. The first is to update the key in the web.config EPnQueryTimeout, make it 600 or something like that (600 = 10 minutes). The other is to update the SQL Server properties. Go to Enterprise Manager, [You database] Properties > Connections > Edit query timeout value here (Should default to 600 also).
Jeremy.
Hello!
I just added a code sample that clears old versions from the database as a scheduled job. It also shows how it's possible to set the user context when executing a scheduled job. This feature was added in EPiServer 4.61 and does not work in older versions.
http://www.episerver.com/en/EPiServer_Knowledge_Center/developerforum/2628/2640/Remove-old-versions-job/
On the Support Tools page (http://world.episerver.com/Support/Support-Tools/) you'll find a job called RemoveOldPageVersionsJob. It enumerates pages, calling the SP editDeleteObsoletePageVersions to truncate the number of kept versions.