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