1

We have different site collections for storing the document libraries. The document libraries are uploaded to sites through code from other systems and there is no manual intervention.

Due to application design, some site collections are over growing with 10000 document libraries and site size is growing above the threshold limits .

We have plan to move the some 5000 document libraries to other site collections so that the site storage could be below threshold levels.

How to move these 5000 document libraries through Powershell script?

2 Answers 2

0

You can try to export each library as a cmp file then import them into the target site collection.

Export-SPWeb

Import-SPWeb

3
  • it would be a manual and tedious task by this import and export methods. Actually planning to move some 100 libraries in batch mode via any script or exe
    – kumar
    Jun 26, 2018 at 13:07
  • How big is the site? You expect the target site to grow? Export and import SUCKS for performance and I would think about doing a backup spsite and restore it, then delete the 5000 lists you don't need. Most likely this will be faster. Make sure each site is in its own contentDB. You said script... AVOID calling the list API _api/web/lists/GetByTitle , which kills performance on 1000's of lists Jun 27, 2018 at 8:40
  • if you do the delete list and don't expect growth, make sure you shrink and defrag after the cleanup part. If you expect growth back to the initial levels within a year or 2, don't shrink and defrag. Make sure each Sitecollection is in its own DB Jun 27, 2018 at 8:42
-1

Few suggestions

1.REST API Check this link

/getfilebyserverrelativeurl('/Shared Documents/filename.docx') /moveto(newurl='/Other Folder/filename.docx',flags=1)

  1. SPD workflow 2010 - You can use the Copy List Item action to copy a document from one library to another

Or you can write a code.

Regards, Balakrishnan

2
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – MHeld
    Jun 26, 2018 at 14:08
  • Thanks MHeld , will provide the essential parts of answer instead of providing the link Jun 27, 2018 at 6:18

Your Answer

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

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