3

I'd like to copy a list (and its contents) onto our production server. I've been trying to use the Export-SPWeb cmdlet, using this article as a reference, but I can't seem to get it to cooperate. I've successfully exported the whole web, but not individual lists, which is what I would prefer to do.

This is what I've tried:

PS J:\> export-spweb http://mysite -itemurl "lists/mylist" -path "c:\temp\mylist.cmp"

This is the (quite unhelpful) error message I get:

Export-SPWeb : <nativehr>0x80070057</nativehr><nativestack></nativestack>
At line:1 char:13
+ export-spweb <<<<  $web -itemurl "lists/mylist" -path "c:\temp\mylist.cmp"
    + CategoryInfo          : InvalidData: (Microsoft.Share...CmdletExportWeb:
   SPCmdletExportWeb) [Export-SPWeb], ArgumentException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletExportWe
   b

I believe it has to do with the -itemurl switch, because, when I take it out, powershell successfully exports the whole web.

0

3 Answers 3

3

You need a slash at the start of the ItemUrl parameter. Your command should look like:

export-spweb http://mysite -itemurl "/lists/mylist" -path "c:\temp\mylist.cmp"

Reference

0
1
export-spweb http://servername/sites/PonniTest/ -itemurl "Lists/Try" -Path C:\raks.cmp

Note: Your Url should be terminated with a slash.

0
Export-SPweb -Identity http://site/sub1/sub2 -Path "c:\lstExport\lstName.cmp" -ItemUrl "/sub1/sub2/lstName" -IncludeUserSecurity -Force -IncludeVersions All

Add slash("/") at the start of the ItemUrl parameter.

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.