Document History Versions
A doc library with turned on function of versioning after any changes of an item. Want to turn it off and delete all history version. This will redeem grand piece of space. Tried to just turn off versioning and free unused space from sql db. Didnt work because all these versions are still there and you can see em after turning version control back. There are over 1k files in a lib and i dont want to manually crawl over each one and cut off these versions.
September 2nd, 2010 3:58pm

I made a service field to touch each item, then turned off versioning and changed each field in excel view. This should work for small files. Sadly i have some 70 mb files with 30+ versions _) Such monster items result in errors while trying above mentioned trick.
Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2010 4:08pm

I'm not aware of a proper fix for this without writing a bunch of code to do it, but I have 2 duct-tape ways to solve your problem. LIMITING: 1) Go into Document Library Settings > Versioning Settings > Document Version History > Optionall limit the number of version to retain. 2) Set the number to something small, like 3. 3) The next time a user modifies or uploads a new version of a document in that library, all but the latest 3 versions will be deleted. This allows you to maintain a small amount of the versioning functionality, but it also will automatically clean up a bunch of space. Well, not automatically. But as users continue to muck around in your library, it will essentially self-clean. Then you can do a little SQL magic to shrink the database. COPYING: Create a new folder in the document library, copy everything to that folder, delete the originals, and then move the documents back to the root. This will delete all versions since you're really dealing with a new file, but you will lose all your dates, created by info, etc. This would bother the heck out of me, but your organization may vary.
September 2nd, 2010 4:29pm

thank you man, 1) I have many 50+ mb files with 30+ versions items. This method results in timeout error (when i turn versioning off or set limit to 1 version). Sadly ( 2) Yes i have over 20 field in doclib, that i can not lose no matter what. I ended up tricking method 2. I created a template of original doclib, extracted a twin empty doclib from template. Turned off versioning! Then saved all the meta in table view, moved files and finally deployed matrix. Now everything is fine.
Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2010 5:48pm

You can use either Object model code or PowerShell to delete versions, $SPweb = Get-SPWeb "http://SharePointSite.com" $versionsToKeep =5; $SPlist = $SPweb.Lists["Tasks"] foreach ($SPitem in $SPlist.Items) { $currentVersionsCount= $SPItem.Versions.count if($currentVersionsCount -gt $versionstoKeep) { for($i=$currentVersionsCount-1; $i -gt $versionstoKeep; $i--) { $SPItem.versions[$i].delete() } } } More info: http://salaudeen.blogspot.co.uk/2011/01/limitcleanup-versioning-in-sharepoint.html
April 10th, 2012 3:42am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics