Export-SPWeb: "The Url provided is invalid"...
-
Monday, October 18, 2010 9:49 AM
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?
All Replies
-
Monday, October 18, 2010 10:51 AM
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 -
Monday, October 18, 2010 12:30 PM
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 -
Monday, October 18, 2010 2:40 PM
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
-
Thursday, January 13, 2011 7:16 PM
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!
-
Wednesday, February 02, 2011 2:05 PM
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
-
Wednesday, February 02, 2011 2:51 PM
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 02, 2011 2:52 PM
-
Wednesday, February 02, 2011 2:57 PMThanks a lot for your message! I will try using "/Shared Document"! I hope it works for me too!
-
Monday, February 07, 2011 3:57 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?
-
Sunday, February 27, 2011 5:12 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.
-
Sunday, March 13, 2011 11:20 AM
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
-
Thursday, March 17, 2011 2:00 PM
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 -
Tuesday, March 22, 2011 2:30 PM
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
-
Tuesday, March 22, 2011 10:14 PMExcellent Hazet, your solution worked for me! Thanks a bunch!
-
Wednesday, March 23, 2011 11:54 AMPleasure :)
-
Thursday, December 29, 2011 5:33 PM
WORKED LIKE A CHARM!
I had a list that was two levels deep and I kept getting the The URLprovided is invalid too. I took out the "/" before the -ItemURL "Lists/<listname>" and it worked perfect.
Jen -
Tuesday, January 22, 2013 9:35 AM
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.

