Is it Possible to Set the Version Number of SHarePoint Document

Iron Contributor

I have two site collections in SharePoint Online. One is the live site collection and one is the Testing Site.

I want to upload a document onto the Test Site Collection, make some changes to it and then copy the document to the live site collection setting the version number to be the version number of the document on the Testing Site.

Thanks

Nigel

9 Replies
You can use a content migration tool like Sharegate to preserve versions. The version-related properties are not settable.

Do you want just the version number, or do you intend to carry past versions along with it?

Hi Trevor

 

If Sharegate can do this, then there must an api somewhere which I can use. Either via SPFx webpart of PowerShell.

 

I just need to find it.

 

Regards

 

Nigel

Sharegate copies the *versions* of the documents. It doesn't just set the final version.

Hi @Matt Coats I just need the version number of the latest published version - I dont need the past versions.

 

Regards

 

Nigel

if you're scripting it yo can just do repeated checkout/checkin until it hits the required version. crude, but it works.

Totally agree here with Russell...you need to emulate the document lifecycle in your copy process in some way so you can have the desired version at the destination site. Sharegate does this, but copying all the versions of the document

I think that you should be able to use the Cross Site publishing functionality to do that, see https://docs.microsoft.com/en-us/sharepoint/dev/general-development/cross-site-publishing-in-sharepo...

what if we want to do both, bring the version number and the old docs...@Matt Coats