Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
Thanks for the pointer and the article reference - export-spweb works great! –  Daniel Dec 3 '13 at 19:24

2 Answers 2

up vote 2 down vote accepted

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

share|improve this answer
    
Thanks, that was my issue. –  nfw Aug 22 '11 at 20:30
export-spweb http://servername/sites/PonniTest/ -itemurl "Lists/Try" -Path C:\raks.cmp

Note: Your Url should be terminated with a slash.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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