Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 314
Ole Albers Avatar asked Jul 14 '11 07:07

Ole Albers


People also ask

How do I restore a database from SharePoint 2010 backup?

To restore a SharePoint farm and web applications, go to Backup and Restore page as shown below. Click on the Restore from a backup link to go to restore page. On the first step of restore, specify the shared location where you have stored the backup and click on the Refresh button.

How do I backup a collection in SharePoint 2013?

On the Site collection backup page, select the site collection from the Site Collection list. Type the local path of the backup file in the Filename box. If you want to reuse a file, select the Overwrite existing file check box. Click Start Backup.


1 Answers

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:

  • SharePoint 2010 Granular Backup-Restore Part 1
  • Failing to export with Export-SPWeb
like image 153
Marek Grzenkowicz Avatar answered Sep 30 '22 13:09

Marek Grzenkowicz