I've been looking on the internet and all I find are "how to move one document library from one site to another". My question is, is there a PowerShell script where I can copy a document library, which contains files and folders that contains files, and put it in the same site. For example, I have a library called Large_Library and I want to copy its contents in the same site and call or rename the newly created document library Large_Library2. Is it possible?
You can do it either using GUI or powershell.
- 1st save the document library as template( with include content options)
- Create new document library using that template. But their are size limitation.
You can also do it via powershell.
- 1st export the document library using this command.
Export-SPWeb -Identity <SiteURL> -Path <Path and File Name> [-ItemUrl <URL of Site, List, or Library>] [-IncludeUserSecurity] [-IncludeVersions] [-NoFileCompression] [-GradualDelete] [-Verbose]
- Now import it using the powershell. Import-SPWeb -Identity -Path [-Force] [-NoFileCompression] [-Verbose]