I am trying to copy files from one site collection to another including their version history and preserve the metadata using CSOM. I am almost there using the below logic for each version of the file. However I am not able to get this to work for major/published/X.0 versions.
1) Check out existing file (If not first version uploaded)
2) Upload the file version
3) Assign the document metadata and perform a checkin (either major or minor to match original files version history).
4) Use ValidateUpdateListItem to set the Editor and Modified values as they were overwritten by the checkin in step 3
This works in most scenarios and keeps the modified date. However if the version was a published version and minor versions are enabled this creates a new X.1 version.
Does anyone have a way of updating the Editor for a published version with minor versions enabled on the list that does not affect the version number? The only solutions I have found require server side code or temporarily disabling versioning which I cannot do!
Requirements:
CSOM only - this is client side C# code.
I cannot temporarily enable/disable versioning or minor versions on the library.