Tag Archives: PowerShell

Export-SPWeb Tells Me “InvalidData” But the Data is Valid

I’m in the process of writing an article for the good people at www.sharepointbriefing.com and it involves deploying an list from a development farm to a production farm.  I’m still accustomed to using stsadm and need to break that habit, so I fired up the SharePoint 2010 Management Shell and played around using Export-SPWeb to backup my list.  What a strangely difficult thing that proved to be!

I kept getting this error:

image

That error, “InvalidData: (Microsoft.Share…CmdletExportweb"”) was killing me.  I’m embarrassed at how long I struggled with this.

I had previously run into a wall with PowerShell and used stsadm to get around it.  I tried it again this time and I got good results.

I spent a lot of time fiddling around with the –Identity option and then finally with –ItemURL.  It turns out that the ItemURL option requires a full path of the list/library you  want to export without the http://server bit.  So, despite the fact that the Identity argument is pointing to a subsite, the ItemURL is not relative to the Identify but relative to the site collection.

It would have been nice for the cmdlet to tell me what was minimally valid (the Identity in this case) and what was invalid (ItemUrl).  These little touches help people embrace the product.  Not a big ding against SharePoint, but a little one at least 🙂

Hopefully this post will save someone a bit of grief in future.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin