Start-VESQLDatabasePublish
Short Description
Publishes a backed-up Microsoft SQL Server database.
Product: Veeam Backup & Replication
Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
This cmdlet provides the following parameter sets:
-
PublishUsingCredentialsFromVBRStart-VESQLDatabasePublish [-Database] <VESQLDatabase> [-DatabaseName <String>] -ServerName <String>
[-InstanceName <String>] [-Port <Int32>] [-ToPointInTimeUtc <DateTime>] [-Force] [<CommonParameters>]
-
PublishUsingCredentialsStart-VESQLDatabasePublish [-Database] <VESQLDatabase> [-DatabaseName <String>] -ServerName <String>
[-InstanceName <String>] [-Port <Int32>] [-UseSQLAuthentication] -SqlCredentials <PSCredential>
[-GuestCredentials <PSCredential>] [-ToPointInTimeUtc <DateTime>] [-Force] [<CommonParameters>]
-
PublishUsingGmsaAccountStart-VESQLDatabasePublish [-Database] <VESQLDatabase> [-DatabaseName <String>] -ServerName <String>
[-InstanceName <String>] [-Port <Int32>] -GMSAAccount <String> [-ToPointInTimeUtc <DateTime>] [-Force] [<CommonParameters>]
Detailed Description
This cmdlet allows you to publish a backed-up Microsoft SQL Server database to a target server.
Parameters
|
Parameter |
Description |
Type |
Required |
Position |
Accept Pipeline Input |
|---|---|---|---|---|---|
|
Database |
Specifies a Microsoft SQL Server database that you want to publish.
Accepts the |
True |
0 |
True (ByValue) |
|
|
DatabaseName |
Specifies a new name for a Microsoft SQL Server database. The cmdlet will publish the existing database with this name. |
|
False |
Named |
False |
|
Force |
Defines that the cmdlet will overwrite the existing database with the database from the backup. Note: The cmdlet will show no prompt before executing the command. |
|
False |
Named |
False |
|
GMSAAccount |
Specifies the name of the Group Managed Service Account (gMSA). The cmdlet will use this account to authenticate to Microsoft SQL Server on the target machine. |
|
True |
Named |
False |
|
GuestCredentials |
Specifies credentials for authenticating to the target server. If these credentials do not work, the cmdlet will use the credentials specified in the backup job. Consider the following:
Accepts the |
|
False |
Named |
False |
|
InstanceName |
Specifies the name of the target instance. The cmdlet will publish the Microsoft SQL Server database to that instance. |
|
False |
Named |
False |
|
Port |
Specifies a port number. The cmdlet will use this port to connect to the target machine with Microsoft SQL Server. |
|
False |
Named |
False |
|
ServerName |
Specifies DNS name or IP address of the target server. The cmdlet will publish a Microsoft SQL Server database to that server. |
|
True |
Named |
False |
|
SqlCredentials |
Specifies the credentials for authenticating to Microsoft SQL Server on the target machine. Note: If you do not specify SQL credentials, the cmdlet will use the current account credentials. If these credentials do not work, the cmdlet will use the credentials specified in the backup job.
Accepts the |
|
True |
Named |
False |
|
ToPointInTimeUtc |
Specifies a point in time within the restore interval of a Microsoft SQL Server database. The cmdlet will publish the database to the state of the specified point in time. Note: Make sure that the value you assign to this parameter is converted to Universal Coordinated Time (UTC). |
|
False |
Named |
False |
|
UseSQLAuthentication |
Defines that the cmdlet will use SQL authentication to connect to Microsoft SQL Server on the target machine.
Note: If you omit this parameter, the cmdlet will use the credentials specified in the |
|
False |
Named |
False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About Common Parameters section of Microsoft Docs.
Output Object
The cmdlet returns the VESQLDatabasePublish object that contains a published Microsoft SQL Server database.
Examples
Publishing Microsoft SQL Server Database to Specific Server
This example shows how to publish a Microsoft SQL Server database to a specific server. This example uses the current account credentials to log in to the guest OS and Microsoft SQL Server on the target machine.
|
$session = Get-VESQLRestoreSession $database = Get-VESQLDatabase -Session $session[0] -Name "SQLDatabase" $publish = Start-VESQLDatabasePublish -Database $database -ServerName "TargetServer" |
Perform the following steps:
- Run the
Get-VESQLRestoreSessionReturns active restore sessions started to perform operations with backed-up Microsoft SQL Server databases. cmdlet. Save the result to the$sessionvariable.The cmdlet will return an array of restore sessions. Note the ordinal number of the necessary restore session. In this example, it is the first restore session in the array.
- Run the
Get-VESQLDatabaseReturns backed-up Microsoft SQL Server databases. cmdlet. Set the$sessionvariable as theSessionparameter value and select the necessary restore session. Specify theNameparameter value. Save the result to the$databasevariable. - Run the
Start-VESQLDatabasePublishcmdlet. Specify the following settings:- Set the
$databasevariable as theDatabaseparameter value. - Specify the
ServerNameparameter value.
- Set the
Related Commands
Get-VESQLRestoreSessionReturns active restore sessions started to perform operations with backed-up Microsoft SQL Server databases.Get-VESQLDatabaseReturns backed-up Microsoft SQL Server databases.