Forum Discussion
versioning fails when copying
- Mar 03, 2020
Hi mtarler,
I thought a custom permission level would work but it did not. I could not find a site, document library or versioning setting that would help either.
This is not ideal, but you can create a trigger to notify you when a file is deleted using Power Automate. This will provide an opportunity to intervene and restore the file (and version history) from the site recycle bin.
I hope this helps.
Norm
Hi - mtarler - I don't have an answer, just more details that my team figured out recently.
Like you said, if you drag and drop a file into a library, you'll be adding a version (if a file with the same name exists).
However, if you use the Move or Copy feature to move/copy a file from another SharePoint/OneDrive library, then it'll completely replace the existing file, including the version history.
If you use the Move or Copy feature when there is no existing file in the destination, the Move feature will bring the version history but the Copy feature won't.
Before we tested all of this, we assumed that copying a file would simply add a new version (like uploading a file) but that's not the case and it feels like a bug to us (poor user experience at best).
Hello mtarler and Deleted,
This is interesting behavior and not what I would have expected. I've reached out to others for confirmation of the behavior. I will follow up when I hear back
I hope this helps.
Norm
- mtarlerMar 02, 2020Silver Contributor
Norman Youngthank you for looking into this. I have some more information to add:
If you map a network drive to sharepoint I found everything appears to work correctly from there. Specifically:
a) copying a file from another library to the controlled library (both using file explorer windows) will say 'no' if it isn't checked out or create a new version if it is checked out and you 'over write'.
b) copying from another library using file explorer and dragging to edge window with controlled library will also create a new version when you over write a checked out file
also interestingly:
a) in the mapped drive in file explorer you can rename a file in a controlled library without checking it out
b) you can right click (or ctrl click) to copy a file you are dragging (in edge it will only move the file using the click and drag)
c) a down side to using the mapped drive in file explorer appears to be the inability to check out/ check in documents (although you are prompted when you open documents and such)
- Norman YoungMar 02, 2020MVP
Turns out this behaviour is by design.
When you use Copy to with documents that have version history, only the latest version is copied. To copy earlier versions, you need to restore and copy each one.
More information on the Copy files and folders between OneDrive and SharePoint sites site.
Thanks to Susan Hanley for pointing us to the official answer.
I hope this helps.
Norm
- mtarlerMar 02, 2020Silver Contributor
Norman Youngsorry I didn't see your reply while I posting my updated info.
But your answer does NOT help. I know that behavior and even mentioned it in my original post. The behavior I have complaint with is that if you copy or move a file to over write a file in a protected library it doesn't save the previous version. If I upload from my computer (which is basically what I guess is also happening using the mapped drive technique I mentioned just a few mins ago) it overwrites the file but adds it as a new version (i.e. maintains the old file a prior version). Even, as I just noted in my update, if I copy or move a file between 2 windows using the mapped drive in file explorer it over writes the file as a new version. BUT if you use the copy or move feature in the online sharepoint to over write a file with a new version it completely wipes out the prior version. That seems to defeat the whole controlled library point.
- mtarlerMar 02, 2020Silver Contributor
Let me give an example because I think it might be confusing:
I have Doc123 and it is an a controlled library with versions 1.0, 2.0, 3.0, 4.0 and the current version is 5.0
IF I copy that Doc123 somewhere else I understand that it will ONLY copy version 5.0 and lose all the prior history.
IF I check out Doc123 and upload a local updated version of the document to over write it, it will then become version 6.0 and I can then check it back in.
IF my new updated version of the document is in a shared working directory in a different sharepoint library, then if I copy that file (using the online copy to feature) when it overwrites Doc123 in the controlled library it wipes out all previous versions there also (i.e. not only does it not keep prior versions from the source file you are copying from but it also wipes out all prior versions of the file you are copying it TO).
Let me explain why this is such a PROBLEM:
The 'how it is intended to work' is fine since if you MOVE a file you keep all version history and if you COPY a file you only keep the most recent version BUT the original still has the full version history. So that is all fine. But if I have a pdf file (let's say a pdf drawing from SolidWorks) in a protected controlled library that must keep all past versions and I need to update it I have to overwrite it using a new pdf created from SolidWorks. That works if I upload it from my desktop but gets destroyed if I copy it from a shared/working library. Fine, I know to download the file then upload it to prevent loss, but what if a new employee comes in and doesn't know. How do I protect my version history.