SPRestoreSettings.BackupId Property
Gets or sets the ID of the backup that is restored.
Namespace: Microsoft.SharePoint.Administration.Backup
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Property BackupId As Guid
Get
Set
'Usage
Dim instance As SPRestoreSettings
Dim value As Guid
value = instance.BackupId
instance.BackupId = value
public Guid BackupId { get; set; }
Property Value
Type: System.Guid
A Guid that uniquely identifies the backup that is restored. The default is all zeros.
Remarks
If this property is left at the default, then the most recent backup is used.
If you want to restore from a backup other than the most recent, identify the backup package by assigning its GUID to the BackupId property before you use the SPRestoreSettings object to create an operation — an SPBackupRestoreConsoleObject object. For more information about how to create an operation, see CreateBackupRestore().
A record of each backup operation for a particular backup location is stored in spbrtoc.xml in the root of the location. Each backup and restore operation is represented in the file by an <SPHistoryObject> element. If the operation is a backup, then the <IsBackup> child of the <SPHistoryObject> element is "True". The <SPId> element of the <SPHistoryObject> element contains the GUID of the backup.
Note To programmatically obtain the list of all backup and restore operations, use the GetHistory() method. This returns an SPBackupRestoreHistoryList object that contains SPBackupRestoreHistoryObject objects. Each of the latter represents an operation and holds its GUID in the SelfId property.