Is it Possible to Set the Version Number of SHarePoint Document

%3CLINGO-SUB%20id%3D%22lingo-sub-154341%22%20slang%3D%22en-US%22%3EIs%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154341%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20class%3D%22postcell%22%3E%3CDIV%3E%0A%3CDIV%20class%3D%22post-text%22%3E%0A%3CP%3EI%20have%20two%20site%20collections%20in%20SharePoint%20Online.%20One%20is%20the%20live%20site%20collection%20and%20one%20is%20the%20Testing%20Site.%3C%2FP%3E%0A%3CP%3EI%20want%20to%20upload%20a%20document%20onto%20the%20Test%20Site%20Collection%2C%20make%20some%20changes%20to%20it%20and%20then%20copy%20the%20document%20to%20the%20live%20site%20collection%20setting%20the%20version%20number%20to%20be%20the%20version%20number%20of%20the%20document%20on%20the%20Testing%20Site.%3C%2FP%3E%0A%3CP%3EThanks%3C%2FP%3E%0A%3CP%3ENigel%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-154341%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDocument%20Library%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-660949%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-660949%22%20slang%3D%22en-US%22%3E%3CP%3Ewhat%20if%20we%20want%20to%20do%20both%2C%20bring%20the%20version%20number%20and%20the%20old%20docs...%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F32928%22%20target%3D%22_blank%22%3E%40Matt%20Coats%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154932%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154932%22%20slang%3D%22en-US%22%3E%3CP%3EI%20think%20that%20you%20should%20be%20able%20to%20use%20the%20Cross%20Site%20publishing%20functionality%20to%20do%20that%2C%20see%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fgeneral-development%2Fcross-site-publishing-in-sharepoint%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fgeneral-development%2Fcross-site-publishing-in-sharepoint%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154814%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154814%22%20slang%3D%22en-US%22%3ETotally%20agree%20here%20with%20Russell...you%20need%20to%20emulate%20the%20document%20lifecycle%20in%20your%20copy%20process%20in%20some%20way%20so%20you%20can%20have%20the%20desired%20version%20at%20the%20destination%20site.%20Sharegate%20does%20this%2C%20but%20copying%20all%20the%20versions%20of%20the%20document%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154801%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154801%22%20slang%3D%22en-US%22%3E%3CP%3Eif%20you're%20scripting%20it%20yo%20can%20just%20do%20repeated%20checkout%2Fcheckin%20until%20it%20hits%20the%20required%20version.%20crude%2C%20but%20it%20works.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154396%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154396%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F32928%22%20target%3D%22_blank%22%3E%40Matt%20Coats%3C%2FA%3E%20I%20just%20need%20the%20version%20number%20of%20the%20latest%20published%20version%20-%20I%20dont%20need%20the%20past%20versions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegards%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENigel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154379%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154379%22%20slang%3D%22en-US%22%3ESharegate%20copies%20the%20*versions*%20of%20the%20documents.%20It%20doesn't%20just%20set%20the%20final%20version.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154377%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154377%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Trevor%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20Sharegate%20can%20do%20this%2C%20then%20there%20must%20an%20api%20somewhere%20which%20I%20can%20use.%20Either%20via%20SPFx%20webpart%20of%20PowerShell.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20just%20need%20to%20find%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegards%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENigel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154371%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154371%22%20slang%3D%22en-US%22%3E%3CP%3EDo%20you%20want%26nbsp%3B%3CEM%3Ejust%3C%2FEM%3E%20the%20version%20number%2C%20or%20do%20you%20intend%20to%20carry%20past%20versions%20along%20with%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154369%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20it%20Possible%20to%20Set%20the%20Version%20Number%20of%20SHarePoint%20Document%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154369%22%20slang%3D%22en-US%22%3EYou%20can%20use%20a%20content%20migration%20tool%20like%20Sharegate%20to%20preserve%20versions.%20The%20version-related%20properties%20are%20not%20settable.%3C%2FLINGO-BODY%3E
Highlighted
Regular 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
Highlighted
You can use a content migration tool like Sharegate to preserve versions. The version-related properties are not settable.
Highlighted

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

Highlighted

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

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

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

 

Regards

 

Nigel

Highlighted

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

Highlighted
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
Highlighted

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...

Highlighted

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