.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Moving Documents between Libraries with Version History Completely Intact

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :SharePoint



Trying to verify that I've found a what I believe is fairly large weakness in the SP API: moving documents while keeping their version history completely intact as they are.


API deals with this in very incomplete way:

- SPFile.Move() does send the versions with document, but wipes out all version's comments and sets their Modified to date of operation and ModifiedBy to user context running code.

-SPCopy has no movement of versions available


Some posts/articles in the community on this.  Solution given is to interate over the source file's versions and run SPFileCollection.Add() of the target folder for each version.  That method has 13 overloads, but none allow you to preserve all aspects of the version - very aggravating:

- One overload allows setting of Modified and ModifiedBy - but not Version comments

- One overload allows setting version comment but not Modified/ModifiedBy.

- One allows sending the version's property bag over, but this seems to have no effect on version comments or Modified/ModifedBy on the destination file.


If anyone in possession of an approach I do not see here wo

View Complete Post

More Related Resource Links

Locating documents with no checked in version across multiple sites and document libraries


I have searched and searched but have not found a solution anywhere. My problem is that we have a number of document libraries that require check out for editing and have mandatory fields. When users upload multiple documents the documents are kept checked out until a value is assigned to the field and the document is checked in. The issue is, that users may not complete the process and subsequently no other users can see the document.

We tried indexing the 'Checked out to' field and allowing for users to search based on this. However, this does not display documents with no checked in version and as such does not help...

Is there some way that we can make the search indexer crawl these documents or have a web part that lists documents checked out to the logged in user? We are using SharePoint Foundation 2010 which may make this more difficult.

How to Add a Version History of SPlistItem ?


Now , I import the splistitem data from a list to another list, but  the listitem's version history disappear, Also I can get the splistitem's Version . what should I do to add each Version History of  the   listItem ???

Can you give me some code ?

Help me ,




Version history file properties



I move files into different folders programmatically. If a file was changed and it will be move again the new file is the actual file and the old file remained in the verison history.

How I save the new version:
SPFile destfile=website.getFile(destUrl);

Normally when you upload the new file with changed properties manually you see the changed properties in the version history.
When I do this programmatically I have the new file with the main version but the changed properties would not be displayed.
Can anybody help me?

Thanks and Regards

Uploading documents directly to record center libraries in MOSS


Hello all,

We have several pdf documents that are records and we want to maintain them in record center. These documents were not part of any collaboration sites. They are all in a shared folder. So there is no audit history and version history for these documents which is typical of any collaboration area documents.

The question I have is, will there be any disadvantages of directly uploading the document to record center library instead of setting up routing rules and submitting the document using OfficialFile.asmx.

I have noticed that when we submit a document using Send To, Record Center's default router renames the file and makes it a unique file name by appending _uniqueId. In my case, all the files are uniquely named and I am not worried about file name clashes.

Is it advisable to directly upload the documents to record cente

Unable to export/copy documents out of SharePoint 2007 libraries

Hi, A client had an issue a few months ago where their MOSS 2007 home site collection had to be restored after a major crash, it now works but they have loads of issues with the restored site(no need to go into) now I am trying to migrate the Data (files and folders only, no security or metadata) to a SharePoint 2010 installation, the problem is that I am unable to get any of the files out of SharePoint. I decided against an upgrade or any form of site migration as I might only be taking the problems with me. i am just trying to copy the files using the "Library - Actions - Open with Windows Explorer". The Explorer view window opens but if i select a file and move it into a folder on the server nothing happens, If I select a folder with files and folders in it then only the root folder is copied over but it is empty.  i don't want to repair any of the issues with the old site as it's only wasting time, can anybody think of a way to get all of the data out of Sharepoint 2007, without taking any of the lists or libraries or any other Sharepoint settings. I only need to keep the folder structure and files within them as i don't need any metadata and am recreating the security again seperately on the new SharePoint setup. Anybody have any ideas or know of free/trial products that i

cannot edit documents in newly created libraries

I've been struggling with this for about a month now, so it's really makin' me crazy at this point! Here's what seems to be happening: My document libraries that were in in place pre-grade are fine, but in all the new document libraries that have been created post-2010 upgrade, the only way anyone can edit these documents is to go in thru Explorer view.. My Library settings are set to 'open in client application' since we're only using Foundation, but I have tried 'open in browser' with no luck. Edit document & Check out are both disabled on the ribbon. I've tried different permission levels - system account, document owner, you name it. I'm hoping someone here might have a fresh idea or two. Thanks in advance! T

Trying to include version history table inside Word document

Running MOSS 2007 with SP1, Office 2007.   I'm trying to create a table (doesn't have to be a table though) of a document's version history inside the document. This would be the history information kept by SharePoint. Since we can't even easily get just the current version number into the document I'm having problems and thought I'd see if anybody has a bright idea.   First, a couple facts. From Word 2007 it is possible to view the Document Library version information by clicking on the Office Button > Server > View Version History. This brings up the following: Click for screenshot   My goal is to get that version information displayed IN the document so when it is printed there is a document history. I tried using IRM label policies, but this only displays the current version and you can't include the comments.   After some digging I found the following code sample on MSDN:   Code SnippetDim dlvVersions As Office.DocumentLibraryVersions    Dim dlvVersion As Office.DocumentLibraryVersion    Dim strVersionInfo As String    Set dlvVersions = ActiveDocument.DocumentLibraryVersions    If dlvVersions.IsVersioningEnabled Then        strVersionInfo = "This document has " & dlvVersions.Count & " versions: " & vbCrLf        For Each dlvVersion In dlvVersions            strVersionInfo = strVersionInfo & _                " - Versi

Trans Libraries Documents Transport

I need to move documents from one lib in site to another lib on the same site. I want to save wf statuses and histories. Can i do it on the administrator level?

Version number syncronisation between document libraries

When I perform a Move or Copy operation from one Document Library to another in SP 2010 (using Send To or Manage Copies feature) SP resets the version number to 0.1 even if the version number in the source library is 4.2 (for example). All other Metadata is copied correctly. Is their anyway to keep version numbers in sync between document libraries? Seems like quite an obvious requirement to me but could not see any other info on the net about this.. thanks in advance

page version history gives error: "value cannot be null. parameter key: name"

Hello, I'm have customized my homepage in SharePoint Designer 2010. I want to go back to a previous version, so I right click on the aspx file in sharepoint designer and choose "version history". When I do that I get this message: There was an error connecting to the server. The server error encountered is "Value cannot be null. Parameter name: key" What should I do in order to revert my aspx page to a previous version ?

can we hide 'delete all versions' from version history with the help of javascript?

hello guys, can we hide 'delete all versions' or tool bar from version history. Can we write some JavaScript to do that?  Thanks

Using a List View web part to display documents from multiple document libraries from different site

Hi there, I am trying to have one web part display documents (or list items) from different document libraries (or different lists) from different site collections. I have achieved this under a single site collection using Data View Web Part (using SPD). I have also achieved displaying a single document library (or a list) from a different site collection by using List View Web Part. but I am not sure how to get my head around displaying documents or list items from different document libraries or lists across site collections. I have thought of using SPSiteDataQuery or ListViewByQuery, but they all seem to focus one site collection at a time. If any of you have done this before, please share your best practice on this one with me. Much appreciated. Clark

Moving Reporting Services Version 2000


Hello All

I've found the topic http://msdn.microsoft.com/en-us/library/ms156421.aspx that provides instruction on moving the Reporting Services Databases; does anybody know if these instructions will work for 2000?

Tony C

Version History for NewForm.aspx


Hi All,

I urgently need to switch back to one of the previous versions of the customized Newform.aspx  form . I dont see any option when i right click on the form but in the properties i see the version as v2.0

any help is appreciated.


Isha kapoor My SharePoint Blog Follow me

Display Version History in List View Column


I am working with a multitext line for comments and I have enabled versioning.  The version history shows in each item within the View Form.  I was wondering if I can have the comments field list in the List View as a column with all the version history.  Right now, it shows as a link "View Entries...".  I would like to be able to view all versioin history in the list view under the comments column.

Is is there a feasible solution?

Thanks in advance.


Auto-fill fields are racking up the version history whether they are on one workflow or many....SPD


I have a whole batch of fields which trigger an automatic date entry when they are changed: if more than one field is changed then a version is created for each field that is changed. I did some more fiddling to see how many of these workflows I could cram into one (originally built to have one workflow per date trigger) and tested again but although the changes are grouped together now the system automatic updates still trigger another version for each automatically entered date. Anyone know how to get around that? Its not unbearable but it just offends me somehow and it might cause a problem later on.

Search the Version history


Seems to me it is not possible out of the box, but is there a way to make Sharepoint display searchresults from the version history of lists and document librarys?

thanks in advance

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend