none
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?

     

    Monday, October 18, 2010 9:49 AM

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
    Monday, October 18, 2010 2:40 PM

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
    Monday, October 18, 2010 10:51 AM
  • 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 12:30 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
    Monday, October 18, 2010 2:40 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.SPCmdletExportWeb

    PLease help!

    Thursday, January 13, 2011 7:16 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:05 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:51 PM
  • Thanks a lot for your message! I will try using "/Shared Document"! I hope it works for me too!
    Wednesday, February 02, 2011 2: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?

    • Proposed as answer by Joe Crockett Monday, April 07, 2014 10:06 PM
    Monday, February 07, 2011 3:57 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, February 27, 2011 5:12 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

     

    Sunday, March 13, 2011 11:20 AM
  • 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
    Thursday, March 17, 2011 2:00 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 2:30 PM
  • Excellent Hazet, your solution worked for me! Thanks a bunch!
    Tuesday, March 22, 2011 10:14 PM
  • Pleasure :)
    Wednesday, March 23, 2011 11:54 AM
  • 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
    Thursday, December 29, 2011 5: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.

    Tuesday, January 22, 2013 9:35 AM
  • 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


    Wednesday, July 10, 2013 2:37 PM
  • Hello, I am trying to use the itemurl switch to export site pages and am getting the invalid url error also.  I have tried the suggestions here and I am still not being successful.

    Michael K. Tyson

    Tuesday, October 22, 2013 6:38 PM
  • When I used HAZET's snippet I discovered that the root folder for some items was not what I thought it was. Not everything is in /Lists, depending on how the site evolved I guess.
    • Edited by phillyDev Tuesday, March 11, 2014 6:27 PM
    Tuesday, March 11, 2014 6:27 PM