How can you move a document with its version history to a new library?

  • Here's the scenario:

    1. 2 document libraries
    2. Both contain multiple documents
    3. The documents have multiple versions

    When I copy a document from library A to Library B using the Content and Structure tool from Site Settings, my versions do not carry over. I'm trying to merge the two document libraries into one, but I want to retain the versions.

    Do you know of a way to complete this without third party tools or custom code? I've heard suggestions of using Explorer View copy and paste, SharePoint Designer and List Templates, but I'm not sure any of those will carry version info.

    Update 4/24/2018: There's a new solution in Office 365. You can now select a file or group of files in the modern experience in OneDrive or SharePoint and select Move to. A file or group of files moved this way will retain version history.

    Update 1/29/2010: Thanks for all the code suggestions. They will come in handy for other needs, however, I want to stress that this is a no-code deploy situation. Think BPOS.

    I don't know the answer to this and I've struggled with it, so I hope someone has a good thought that doesn't involve C# code!

    I did as instructed and it DID NOT WORK. I moved the file and LOST my versions.

    Is versioning on in the new library? @jaap points out in the comments on his answer, that he tried that and didn't lose the versions. When he moved it back to the original library the versions were retained.

    i also face this problem you but resolve it by using Csom

  • Just moved (drag & drop) a file in Explorer View from one document library to another, and it did retain previous versions!

    Obviously both libraries need to have versioning enabled.

    Try it yourself.

    EDIT: note that it ONLY retains the versions if you MOVE the files. It does not do so when you perform a COPY!

    Too obvious. We needed something harder. ;+) One thing to watch out for on this is that the documents are of the same Content Type. When they aren't, I've seen odd things happen.

    if they are not of same CT, the CT will be copied with the document

    It was second hand, but when items with different Content Types were copied, while the metadata went over just fine, the actual Content Types didn't. In other words, they weren't fully enabled on the destination.

    I just tried this and it didn't work for me. I wonder what was different? I enabled major versions for two libraries on my My Site, Personal Documents and Shared Documents. I uploaded a new version of one document in Shared Documents, copied it to Personal Documents with both in Explorer View. Only the most recent version copied over.

    Did you COPY the file? I MOVED them using drag & drop. Try that one.

    Anyone else want to give it a go?

    Just tried a COPY instead of MOVE, and that did not retain the versions as mentioned by Tom. MOVE (drag & drop) does!

    @Japp you found the answer. Move works, copy doesn't. Can you edit your answer so people don't have to read all the comments to figure it out? Bonus credit if you explin WHY this works. :)

    answer updated :)

    Curious if this preserves the Created/Created By/Modified/Modified By metadata.

    Another funny thing I noticed: I moved a file from doclib A (versioning enabled) to doclib B (versioning disabled). Then moved it back tot doclib A, and it had retained its versions :)

    This is crazy! I was totally convinced there were no way to do that. Kudos to you, sir!

    and now - how to do this programatically?

    @Jaap, I have a slide library and have tried the drag & drop method you described into another slide llibrary with the same versioning settings, and I seem to get an error, "cannot read from source file or disk." Any advice? Thanks!

    When I try this, it moves the document, and checking version history it appears to keep both minor and major version, but Modified Date and Modified By are all set to the current user that performed the Move, as opposed to the real data which was different dates and users.

    Ok, I know this is an old post, but I am using SP 2010 Foundation, and simply dragging and dropping (moving) the files from one doc lib to another does not FULLY transfer metadata and versions. I would think the point is when moving files, that all metadata for versions (version #, who made the version, and when) would be retained. The versions are retained, but who modified it and when changes with the file move. So this solution works only in part, it does NOT fully move all version and metadata with the file, just as Kolten from the above comment has mentioned

    Really.. Very much helpful!

    For anyone using Sharepoint online, this does not seem to work. Moving the files to a new document library does not retain version history.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM