I have a Task to move data of Document Library from on Site to sub site, below is the situation, Using office 365 Need to migrate a library and its folder to a sub site where folders would be treated as libraries in that sub site The size of the library is 3.29 GB. I have to write a custom code for this. The various details of the documents etc must be restored like the modification date, version history etc.

  • What is the question? Of course you need write custom code for this task or use 3rd party components from sharegate, metalogix or something else.
    – Roman
    Commented Apr 12, 2014 at 11:53
  • Unfortunately, this doesn't copy over version history. 'Move' functionality still works better but quite tedious. Is there a 'Move-PnPFolder' powershell command that can make this process more automated? Commented Nov 5, 2019 at 18:51

1 Answer 1


You need to save the Document Library as template including its content:

  1. Go to the library you would like to migrate, click LIBRARY in the upper left corner> click Library Settings.
  2. Click Save document library as template > type in the File name and the Template name > select "Include Content" > click OK. Then the template has been saved to List Template Gallery.
  3. Go to the destination site, click Site Contents > click add an app.
  4. In the search box, type in the name of the template you have created to create a new library. The newly created library is the same as the one in another site.

Reference: SharePoint Online - Migrate document library

enter image description here

enter image description here

  • 1
    This absolutely should not have been so hard to find, especially considering it was clearly built to be simple.
    – leigero
    Commented Jan 31, 2018 at 20:53
  • @leigero SharePoint isn’t always obvious :)
    – Benny Skogberg
    Commented Jan 31, 2018 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.