Sunday, October 25, 2009

Delete older versions of SharePoint list/library

Just to give you a brief background of why we developed this utility.

Suppose you have accidentally turned on the versioning feature in your document library and you are migrating data from Lotus Notes to SharePoint using any third party utility like Quest Notes migrator for SharePoint and assume you had to re-run the utility again and again on the version enabled document library so as to migrate notes data with full fidelity. What happens then? Many versions of the same document/list item get created.

Assume there are 4000 records which got properly migrated into the versioned enabled document library, but each record created many versions of the same item, as a result average size of each item went to somewhere around 400-500 MB and some of them items were also 1 GB in size.

The site was also deployed into Production. Clients encountered performance issues while accessing items in the document library since the size of the document library had sky rocketed.
What do you do in this case? How do you delete the unnecessary versions and retain only the latest version of the document/list item?

My utility will just do that for you, Delete Item Versions utility will delete older versions of the document library items, while retaining the most recent version of the same. Most of the times, the site is already deployed and running into the production environment, hence , we needed a utility, which can access our production site remotely from any local workstation without touching or deploying anything on the production environment.

We have tested this utility thoroughly and it works like a charm. It uses SharePoint web services and users can run it from their workstations provided they have access to that particular SharePoint webapplication.
We also plan to enhance the features of this utility. Here is a snapshot of the same:

Delete Item Versions
Snapshot of the Delete Item Versions utility
Click here to download the source code.

NOTE: You will have to change the webservice reference in the source code, Build the Project, Test the utility in your test environment and then use the DeleteItemVersions.exe for remotely deleting versions for your SharePoint List/Library.

Feel free to share your comments and ask me in case of any doubts.

I regularly post my SharePoint Insgihts at www.SharePointInsights.com

You can also follow me on Twitter: http://twitter.com/Mehul_Bhuva