This is an archive version of the document. To get the most up-to-date information, see the current version.

Start-VBRSQLDatabaseRestore (obsolete)

Short Description

Starts Microsoft SQL database restore.

Note

This cmdlet is no longer supported, use the Start-VESQLRestoreSession cmdlet instead. To learn more about the Start-VESQLRestoreSession cmdlet, see the Veeam Explorers PowerShell Reference.

Applies to

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

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

Database

Specifies the database you want to restore.

Accepts VBRSQLDatabase type.

True

Named

True (ByValue,
ByProperty
Name)

False

ServerName

Used for restoring to another location.

Specifies the name of the target server. The database will be restored to that server.

False

Named

False

False

InstanceName

Used for restore to another location.

Specifies the name of the instance. The database will be restored to that instance.

False

Named

False

False

DatabaseName

Used for restore to another location.

Specifies the new name of the database. The database will be restored with that name.

False

Named

False

False

Guest
Credentials

Specifies the user credentials to authenticate with the target server.

If not specified, Veeam will use the credentials indicated in the backup job settings.

False

Named

False

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.

False

Named

False

False

ToPointInTime

Used to restore the database to a specific transaction.

Specifies the time of the transaction

False

Named

False

False

Force

If set, the command will overwrite the existing database with the database from backup.

Note: the cmdlet will show no prompt.

False

Named

False

False

Wait

Indicates that the command waits for the process to complete before accepting more input.

False

Named

False

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

Return Type

VBRSession

Example

This example shows how to restore a database to a selected point in time to the original location.

  1. Get the database you want to restore.

Run Get-VBRApplicationRestorePoint to get the "CRM_db" restore point. Save it to the $restorepoint variable.

$restorepoint = Get-VBRApplicationRestorePoint -SQL -Name "crm_db"

Select the third restore point from the list and run Get-VBRSQLDatabase with the $restorepoint[2] variable to get the database named "Locations". Save it to the $locations_db variable.

$locations = Get-VBRSQLDatabase -ApplicationRestorePoint $restorepoint[2] -Name "Locations"

  1. Get the credentials to connect to the server and to the database instance.

Run Get-VBRCredentials to get the credentials to authenticate with the target server. Save it to the $guestcreds variable.

Run Get-VBRCredentials to get the credentials to authenticate with the Microsoft SQL instance. Save it to the $sqlcreds variable.

$guestcreds = Get-VBRCredentials -Name "tech\administrator"

$sqlcreds = Get-VBRCredentials -Name "sql_administrator"

  1. Run Get-VBRSQLDatabaseRestoreInterval to check the available restore interval. Select the time to restore the database.

Get-VBRSQLDatabaseRestoreInterval -Database $locations

  1. Run Start-VBRSQLDatabaseRestore with the saved variables.

Start-VBRSQLDatabaseRestore -Database $locations -GuestCredentials $guestcreds -SqlCredentials $sqlcreds -ToPointInTime "10/28/2015 12:33:39 PM"

Related Commands

Get-VBRSQLDatabase

Get-VBRCredentials