Can i move some documents inside a document library and preserve the document metadata


  • I have couple of documents inside a document library (named A). now i want to move the documents from document library A to be inside another document library on another sub-site... now i try saving the original document library as template, i also try to copy/paste the documents using IE explorer ... but these approaches did not preserve the metadata for the items including Create,Modified,Created by & modified by info ...

    so can anyone adivce if i can use power-shell or other approaches to move the documents from one document library to another,, and preserve all the document metadata ??

    Thursday, April 27, 2017 1:47 PM

All replies

  • User third party tools for moving content from one site to another along with metadata. I have been using Sharegate tools and used free version primarily. You can look for metalogix tools also.





    Please mark as Answer, if this post solves your issue.

    Thursday, April 27, 2017 4:29 PM

  • Hi Johnjohn123

    You will have to write custom code or use third party tools like Metalogix and ShareGate to move documents while preserving the metadata.

    If you use the PowerShell PnP cmdlets , you can move documents from one location to another and then set the metadata accordingly.

    $cred = Get-Credential
    Connect-PnPOnline -url -Credentials $cred
    ##store source file properties
    $fileTest1 = Get-PnPFile -Url DocTest1/debug.log -AsListItem
    ##Move-PnPFile cmdlet to move file from source to target 
    Move-PnPFile -SiteRelativeUrl DocTest1/debug.log -TargetUrl DocTest2/debug.log
    $fileTest2 = Get-PnPFile -Url DocTest2/debug.log -AsListItem
    ##update file properties
    $fileTest2["Modified"] = $fileTest1["Modified"]
    $fileTest2["Created"] = $fileTest1["Created"]
    $fileTest2["Author"] = $fileTest1["Author"]
    $fileTest2["Editor"] = $fileTest1["Editor"]

    Good luck.


    Friday, April 28, 2017 8:29 AM
  • Hi johnjohn123,

    To move the documents from one document library to another document library on an sub site , and preserve all the document metadata, you can use content and structure to copy/move documents.


    Best Regards,

    Lisa Chen

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Saturday, April 29, 2017 7:49 AM