Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Moving Documents between Libraries with Version History Completely Intact

$
0
0

Hi,

 

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 would share it, I would be most grateful.  I must say, if this is the end of the options, and one cannot achieve this, this should be considered a very serious hole in the document management aspect of the platform.

 

Thanks to any and all replies,

 

Grandgousier


Viewing all articles
Browse latest Browse all 25064

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>