In a SharePoint site, as you checkout/modify/checkin a master page, previous versions of the master page are retained in SharePoint and you can see a list of previous versions in the master page gallery. It seems to me that the only way to view the contents of a previous version, is to do a restore of that version - this however will create an additional entry in the version history, which isn't really a new version but simply an artefact of viewing a previous version.
I eventually found a rather brute force method of viewing previous versions by using the stsadm
utility:
stsadm -o export -url http://site -fileneme export.cab -versions 4
then looking in the manifest.xml
file in the cab to then find a pointer to the relevant .dat
file in the cab to view the required previous version. Now this 'solution' is obviously problematic for large sites, as the export operation exports the entire site content.
So here's my question ... If stsadm -o export
can extract previous versions of files, I'm guessing that there is some way to do this programmatically through the SharePoint API. Does anybody know if/how this is possible.