Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
417 views
in SharePoint by 9 20 25

I want to transfar a document library and lists from one site to another using powershell.How to export document library and lists to .cmp files using powershell?

 


1 Answer

0 like 0 dislike
by 9 20 25

To Export Document library and lists use "Export-SPWeb" cmdlet

For Document Library:

Export-SPWeb -Identity {Subsite Url} -ItemUrl {DocLibName} -Path {"ExportFile.cmp"} -Force -Verbose
#Example:
Export-SPWeb -Identity https://debug.to/questions -ItemUrl Sharepoint -Path "C:\Sharepoint\data.cmp" -Force -Verbose

Note: there is no "/" before the library name.

For Lists:

Export-SPWeb -Identity {Subsite Url} -ItemUrl {Lists/ListName} -Path {"ExportFile.cmp"} -Force -Verbose
#Example:
Export-SPWeb -Identity https://debug.to/questions -ItemUrl Lists/Answers -Path "C:\Answers\data.cmp" -Force -Verbose
If you don’t ask, the answer is always NO!
...