Start-VBRSQLDatabaseRestore (obsolete)
Short Description
Starts Microsoft SQL database restore.
Note |
|
This cmdlet is no longer supported, use the |
Platform: VMware, Hyper-V
Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
This cmdlet provides two parameter sets.
- For restoring to the original location:
Start-VBRSQLDatabaseRestore -Database <VBRSQLDatabase> [-GuestCredentials <CInternalCredentials>] [-SqlCredentials <CInternalCredentials>] [-ToPointInTime <datetime>] [-Force] [-Wait] [<CommonParameters>]
- For restoring to another location:
Start-VBRSQLDatabaseRestore -Database <VBRSQLDatabase> [-ServerName <string>] [-InstanceName <string>] [-DatabaseName <string>] [-GuestCredentials <CInternalCredentials>] [-SqlCredentials <CInternalCredentials>] [-ToPointInTime <datetime>] [-Force] [-Wait] [<CommonParameters>]
Detailed Description
This cmdlet starts restore of a selected SQL database.
Parameters
|
Parameter |
Description |
Type |
Required |
Position |
Accept |
|---|---|---|---|---|---|
|
Database |
Specifies the database you want to restore. |
Accepts the VBRSQLDatabase object. To get this object, run the Get-VBRSQLDatabase cmdlet. |
True |
Named |
True (ByValue, |
|
ServerName |
Used for restoring to another location. Specifies the name of the target server. The database will be restored to that server. |
String |
False |
Named |
False |
|
InstanceName |
Used for restore to another location. Specifies the name of the instance. The database will be restored to that instance. |
String |
False |
Named |
False |
|
DatabaseName |
Used for restore to another location. Specifies the new name of the database. The database will be restored with that name. |
String |
False |
Named |
False |
|
GuestCredentials |
Specifies the user credentials to authenticate with the target server. If not specified, Veeam will use the credentials indicated in the backup job settings. |
Accepts the CInternalCredentials object. To get this object, run the Get-VBRCredentials cmdlet. |
False |
Named |
False |
|
SqlCredentials |
Specifies the credentials to authenticate with the target SQL instance. If not specified, Veeam will use the credentials indicated in the backup job settings. |
Accepts the CInternalCredentials object. To get this object, run the Get-VBRCredentials cmdlet. |
False |
Named |
False |
|
ToPointInTime |
Used to restore the database to a specific transaction. Specifies the time of the transaction. |
datetime |
False |
Named |
False |
|
Force |
If set, the command will overwrite the existing database with the database from backup. Note: the cmdlet will show no prompt. |
SwitchParameter |
False |
Named |
False |
|
Wait |
Defines that the command waits for the process to complete before accepting more input. |
SwitchParameter |
False |
Named |
False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.
Output Object
Examples
Restoring Microsoft SQL Database to Original Location
This example shows how to restore a database to a selected point in time to the original location.
|
$restorepoint = Get-VBRApplicationRestorePoint -SQL -Name "crm_db" $locations = Get-VBRSQLDatabase -ApplicationRestorePoint $restorepoint[2] -Name "Locations" $guestcreds = Get-VBRCredentials -Name "tech\administrator" $sqlcreds = Get-VBRCredentials -Name "sql_administrator" Get-VBRSQLDatabaseRestoreInterval -Database $locations Start-VBRSQLDatabaseRestore -Database $locations -GuestCredentials $guestcreds -SqlCredentials $sqlcreds -ToPointInTime "10/28/2015 12:33:39 PM" |
- Get the database you want to restore:
- Run the
Get-VBRApplicationRestorePointReturns restore points created with the VSS-aware image processing enabled. cmdlet. Provide theSQLparameter value. Specify theNameparameter value. Save it to the$restorepointvariable. - Run the
Get-VBRSQLDatabasecmdlet. Set the$restorepoint[2]variable as theApplicationRestorePointparameter value. Specify theNameparameter value. Save it to the$locationsvariable.
- Run the
- Get the credentials to connect to the server and to the database instance:
- Run the
Get-VBRCredentialsReturns credentials records. cmdlet. Specify theNameparameter value. Save it to the$guestcredsvariable. - Run the
Get-VBRCredentialsReturns credentials records. cmdlet. Specify theNameparameter value. Save it to the$sqlcredsvariable.
- Run the
- Run the
Get-VBRSQLDatabaseRestoreIntervalcmdlet. Set the$locationsvariable as theDatabaseparameter value. - Run the
Start-VBRSQLDatabaseRestorecmdlet. Specify the following settings:- Set the
$locationsvariable as theDatabaseparameter value. - Set the
$guestcredsvariable as theGuestCredentialsparameter value. - Set the
$sqlcredsvariable as theSqlCredentialsparameter value. - Specify the
ToPointInTimeparameter value.
- Set the
Related Commands
Get-VBRSQLDatabaseGet-VBRCredentialsReturns credentials records.