Showing posts with label stsadm. Show all posts
Showing posts with label stsadm. Show all posts

Tuesday, February 1, 2011

Delete a Corrupted List Using STSADM

If you have a list that might appear to be in a corrupted state, when you try to delete it using SharePoint Web UI you will get the following error message:

Invalid file name.
The file name you specified could not be used.  It may be the name of an existing file or directory, or you may not have permission to access the file.<nativehr>0x81020030</nativehr><nativestack></nativestack>

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Invalid file name.
The file name you specified could not be used.  It may be the name of an existing file or directory, or you may not have permission to access the file.<nativehr>0x81020030</nativehr><nativestack></nativestack>

Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

By using STSADM operation’s forcedeletelist, you can delete the corrupted list, here is the syntax:

stsadm -o forcedeletelist -url <URL>

Example:

stsadm –o forcedeletelist –url http://sharepointserver/lists/yourcorruptedlist

Tuesday, January 18, 2011

SharePoint STSADM Backup and Restore Commands

The following are examples of different STSADM commands you can use to back up and restore various components of your SharePoint environment.

A full farm backup followed by a restore:

stsadm -o backup -url http://app01/ -directory \\app01\sharepointbackups -BackupMethod Full -Quiet
stsadm -o restore -url http://app01/ -filename \\app01\sharepointbackups –Overwrite

Back up and restore configuration information only:

stsadm -o backup -url http://app01 -directory \\app01\sharepointbackups -configurationonly -quiet
stsadm -o restore -url http://app01 -filename \\app01\sharepointbackups -configurationonly –quiet

Back up and restore a service application:

stsadm -o backup -directory \\app01\sharepointbackups -quiet -backupmethod full -item "Excel Services"
stsadm -o restore -directory \\app01\sharepointbackups -item "Excel Services" –quiet

Back up and restore a site collection:

stsadm -o backup -url http://app01/portalsitecollection -filename \\app01\SharePointBackups\portalsitecollection.bak -overwrite
stsadm -o restore -url http://app01/portalsitecollection -filename \\app01\SharePointBackups\portalsitecollection.bak –overwrite

Export and import a subsite, list, or library:

stsadm -o export –url http://app01/sites/contosoportal/Shared%20documents –filename \\app01\sharepointbackups\SD.bak -quiet -overwrite
stsadm -o import –url http://app01/sites/contosoportal/Shared%20documents –filename \\app01\sharepointbackups\SD.bak -quiet

See also example of performing a SharePoint 2010 Backup and Restore using Powershell.