Start-VEPSQLInstancePublish
Short Description
Publishes backed-up PostgreSQL instances.
Applies to
Veeam Backup & Replication
Product Edition: Community, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
Start-VEPSQLInstancePublish [-Instance] <VEPSQLInstance> [-ToPointInTimeUTC <datetime>] -LinuxCredentials <VEPSQLLinuxCredential> [-ServerName <string>] [-SshPort <int>] [-Force] [-Port <int>] [<CommonParameters>] |
Detailed Description
This cmdlet publishes backed-up PostgreSQL instances.
Parameters
Parameter | Description | Type | Required | Position | Accept Pipeline Input |
---|---|---|---|---|---|
Instance | Specifies a PostgreSQL instance. The cmdlet will publish this instance. | Accepts the VEPSQLInstance object. To get this object, run the Get-VEPSQLInstance cmdlet. | True | 0 | True (ByValue) |
ToPointInTimeUTC | Specifies the point in time in the UTC format within a restore interval of the PostgreSQL instance. The cmdlet will publish the instance to the state of the specified point in time. | DateTime | False | 1 | False |
LinuxCredentials | Specifies Linux credentials. The cmdlet will use these credentials to connect to the Linux VM. | Accepts the VEPSQLLinuxCredentials object. To get this object, run the New-VEPSQLLinuxCredential cmdlet. | False | Named | True (ByValue) |
ServerName | Specifies a name of the target PostgreSQL server. The cmdlet will publish a PostgreSQL instance to that server. | String | False | Named | False |
SshPort | Specifies the SSH port number. The cmdlet will use that port to connect to the Linux VM. Default: 22 | Int32 | False | Named | False |
Force | Defines that the cmdlet will replace the target PostgreSQL instance with the instance from the backup. Note: The cmdlet will show no prompt before executing the command. | SwitchParameter | False | Named | False |
Port | Specifies the port to connect to the published PostgreSQL instance. | Int32 | 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 VEPSQLInstancePublish object that contains information about the publish process for the PostgreSQL instance.
Example
Publishing PostgreSQL Instance to Linux Machine
This example shows how to publish backed-up PostgreSQL instance to a Linux machine.
$session = Get-VEPSQLRestoreSession $instance = Get-VEPSQLInstance -Session $session[0] $securepassword = Read-Host -Prompt "Enter password" -AsSecureString $linuxcreds = New-VEPSQLLinuxCredential -Account "root" -Password $securepassword Start-VEPSQLInstancePublish -Instance $instance -LinuxCredentials $linuxcreds |
Perform the following steps:
- Get the restore session:
- Run the Get-VEPSQLRestoreSession cmdlet. Save the result to the $session variable.
The Get-VEPSQLRestoreSession cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session. In our example, it is the first restore session in the array.
- Run the Get-VEPSQLInstance cmdlet. Set the $session variable as the Session parameter value. Save the result to the $instance variable.
- Get Linux credentials:
- Run the Read-Host cmdlet. Specify the Prompt parameter value. Specify the AsSecureString parameter. Save the result to the $securepassword variable.
- Run the New-VEPSQLLinuxCredential cmdlet. Specify the Account parameter value. Set the $securepassword as the Password parameter value.
- Run the Start-VEPSQLInstancePublish cmdlet. Specify the following settings:
- Set the $instance variable as the Instance parameter value.
- Set the $linuxcreds as the LinuxCredentials parameter value.
Related Commands