Answered by:
Export-SPWeb: "The Url provided is invalid"...

Question
-
I've got a subsite in this address: http://intradev/humanresource/reservationroom/default.aspx. The subsite was created using the blank site template. In the subsite I've created a few lists. I'm trying to export these lists, and I know I can do it via the Central Admin, but I'd like to learn how to accomplish it using PowerShell. The following string is what I'm using to export:
export-spweb http://intradev/humanresource/reservationroom/ -Path reservations -ItemUrl /Lists/Reservations
When I run it, I get this error: "Export-SPWeb : The URL provided is invalid. Only valid URLs that are site collections or sites are allowed to be exported using stsadm.exe"
What am I doing wrong here?
Answers
-
ok, try the syntax below
export-spweb -identity http://<site_url> -itemurl lists/<list_name> -path <drive_letter>:\<directory>\<filename> let me know how you get on.
PT_UK http://redmanta.co.uk/blog Twitter: @redmantauk MCTS:WSS,MOSS,2010 MCITP:2010- Proposed as answer by Paul Turner _ Monday, October 18, 2010 2:46 PM
- Marked as answer by Lily Wu Thursday, October 28, 2010 6:11 AM
All replies
-
have you looked at the full syntax for using Export-SPWeb? The -ItemUrl must be a full valid url ie http://server_name take a look at the full syntax here. You're also missing the -Identity switch to specify what to export.
PT_UK http://redmanta.co.uk/blog Twitter: @redmantauk MCTS:WSS,MOSS,2010 MCITP:2010 -
I tested that, however it didn't help me much. When I seem to have the correct syntax, I get this error:
PS D:\Backup\SharePoint> export-spweb -Identity http://intradev -Path reservationstest.cmp -ItemUrl http://intradev/Lists/reservations/
Export-SPWeb : <nativehr>0x80070057</nativehr><nativestack></nativestack>
At line:1 char:13
+ export-spweb <<<< -Identity http://intradev -Path reservationstest.cmp -Item Url http://intradev/Lists/reservations/
+ CategoryInfo : InvalidData: (Microsoft.Share...CmdletExportWeb: SPCmdletExportWeb) [Export-SPWeb], ArgumentException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletExportWeb -
ok, try the syntax below
export-spweb -identity http://<site_url> -itemurl lists/<list_name> -path <drive_letter>:\<directory>\<filename> let me know how you get on.
PT_UK http://redmanta.co.uk/blog Twitter: @redmantauk MCTS:WSS,MOSS,2010 MCITP:2010- Proposed as answer by Paul Turner _ Monday, October 18, 2010 2:46 PM
- Marked as answer by Lily Wu Thursday, October 28, 2010 6:11 AM
-
I have the same issue. I am using the syntax aas below:
export-spweb -identity http://<server_name> -itemurl http://server_name/lists/tasks -path D:\Test\testmove.cmp
But I keep getting this error:
PS C:\Users\Admin> export-spweb -Identity http://server_name -Path D:\Test\testmove.cmp -ItemUrl http://server_name/Lists/tasks
Export-SPWeb : <nativehr>0x80070057</nativehr><nativestack></nativestack>
At line:1 char:13
+ export-spweb <<<< -Identity http://intradev -Path reservationstest.cmp -Item Url http://intradev/Lists/reservations/
+ CategoryInfo : InvalidData: (Microsoft.Share...CmdletExportWeb: SPCmdletExportWeb) [Export-SPWeb], ArgumentException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletExportWebPLease help!
-
Hi,
Another "Answered" question that's not answered at all! As I read this it is still a problem. And yes I've this same error!
when used for a site collection it is working fine but as soon you use the ItemUrl param it is giving this error <nativehr>0x80070057</nativehr><nativestack></nativestack>
I think it's a bug!
I want to use it in Foundation for moving and archiving libraries.
Paul
-
Found it! You must provide a starting slash on ItemUrl like "/Shared Documents". So not http://site/shared documents or just "shared documents" or 'lists/shared documents'
Good luck
Paul
- Proposed as answer by Paul Live Wednesday, February 2, 2011 2:52 PM
-
-
This is still not working for me. What do you need to put for the 'Identity' paramter? Is is it just the name of the web application or the entire path to the list (my list is 4 levels deep, so do I specify the entire URL to the list, except the list name at the end)? and then in the -itemURlL parameter is it just the name of the list?
I tried it but does not work for me. It tells me the URL provided is invalid.
Can you please post the entire powershell command you used to get it to work?
- Proposed as answer by Joe Crockett Monday, April 7, 2014 10:06 PM
-
Hi,
I was having the same issue but after playing with the command, I finally got it to work, try this:
Export-SPWeb -Identity http://<site>/<subsite> -ItemUrl "Lists/<listname>" -Path \\<server>\<filename>.cmp
The only difference with mine is that it wouldn't work with a preceding slash within the ItemUrl switch.
Hope this helps somebody!
Ian.
- Proposed as answer by Martynenko Anton Monday, May 26, 2014 12:17 PM
-
Hi,
I was facing the same issue, I finally got it to work...
Export-SPWeb -Identity "http://servername:1111/" -ItemUrl "/Lists/Users" -Path "D:\BackUps\List\ListBackUpTest21.cmp"Export-SPWeb -Identity "http://servername:1111/" -ItemUrl "/Shared%20Documents" -Path "D:\BackUps\List\ListBackUpTest21.cmp"
Thanks,
Vijai Anand.R
-
I had the same problem when trying to export the farm. But found the solution here. Thanks. Here is what I've used.
Export-SPWeb -Identity "http://servername:123/ " -Path "D:\YourBackUp\ExportBackUp.dat"
-- VT -
The itemURL consists of the parentWebURl and the RootFolder.
Try this to get the correct value for any list you have:
$(Get-SPWeb -identity http://YourWebSiteCollectionRoot).lists | ft title, @{Name="itemURL"; Expression = { $_.parentWebURL + "/" + $_.RootFolder}}
Cheers
Henrik
- Proposed as answer by HAZET Tuesday, March 22, 2011 2:33 PM
-
-
-
-
I have been through the same issue. Problem is in the syntax of the ItemUrl switch. It has to be relative to the server. So if the full url of the exported object is "http://intradev/humanresource/reservationroom/Lists/Reservations" then the ItemUrl parameter must be supplied in the following form: "/humanresource/reservationroom/Lists/Reservations".
Hope this help.
-
It is working for me..!
for list:-
Export-SPWeb -Identity http://<server>/ -Path C:\exportlist\test\list.cmp -ItemUrl Lists/testList
Export-SPWeb -Identity http://<server> -Path C:\exportlist\test\list.cmp -ItemUrl /Lists/testList
for library:-
Export-SPWeb -Identity http://<server>/ -Path C:\exportlist\test\list.cmp -ItemUrl testList
Export-SPWeb -Identity http://<server> -Path C:\exportlist\test\list.cmp -ItemUrl /testList
Sreekanth
- Edited by u.sreekanthreddy Wednesday, July 10, 2013 3:59 PM updates
-
-
-
-
Thanks Ian. Leaving out the / in front of Lists is what worked for me.
Export-SPWeb -Identity "https://xxx.com/it/ITPortfolios/System Life Cycle/SLC" -Path e:/export/slclist.cmp -ItemUrl "Lists/System Life Cycle" -IncludeUserSecurity -NoFileCompression -Verbose