Search code examples
listsharepoint-2010backupexport

Backup List in Sharepoint 2010 in Shell


I want to backup a List of Sharepoint 2010 using the powershell.

I can backup the list using the central Administration and can also backup the whole Site using

Export-SPWeb -Identity http://siteurl:22222/en-us -Path \\public\backup.cmp

But when I try to export a specific List (with the path that is also shown using the Central Administration):

Export-SPWeb -Identity http://siteurl:22222/en-us/Lists/MyList -Path \\public\backup.cmp

I receive the error:

"The URL provided is invalid. Only valid URLs that are site collections or sites are allowed to be exported using stsadm.exe"

I also tried

Export-SPWeb -Identity http://siteurl:22222/en-us -Path \\public\backup.cmp -ItemURL http://siteurl:22222/en-us/Lists/MyList getting the same error

Thanks in advance


Solution

  • Try to fiddle with the ItemUrl parameter value:

    Export-SPWeb -Identity http://siteurl:22222/en-us -Path \\public\backup.cmp
      -ItemUrl /Lists/MyList
    

    or

    Export-SPWeb -Identity http://siteurl:22222/en-us -Path \\public\backup.cmp
      -ItemUrl /en-us/Lists/MyList
    

    or

    Export-SPWeb -Identity http://siteurl:22222/en-us -Path \\public\backup.cmp
      -ItemUrl "/Lists/MyList"
    

    Different sources show different syntax: