Start-VEPSQLInstancePublish

Short Description

Publishes a backed-up PostgreSQL instance.

Product: Veeam Backup & Replication

Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

This cmdlet provides the following parameter sets:

  • PublishToLinuxTarget

    Start-VEPSQLInstancePublish [-Instance] <VEPSQLInstance> [[-ToPointInTimeUTC] <DateTime>]

    [-LinuxCredentials <VEPSQLLinuxCredential>] [-ServerName <String>] [-SshPort <Int32>] [-Force] [-Port <Int32>] [<CommonParameters>]

  • PublishToWindowsTarget

    Start-VEPSQLInstancePublish [-Instance] <VEPSQLInstance> [[-ToPointInTimeUTC] <DateTime>]

    [-WindowsCredentials <PSCredential>] [-ServerName <String>] [-Force] [-Port <Int32>] [<CommonParameters>]

Detailed Description

This cmdlet publishes a backed-up PostgreSQL instance.

Parameters

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

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

Instance

Specifies a PostgreSQL instance that the cmdlet will publish.

Accepts the VEPSQLInstance object. To get this object, run the Get-VEPSQLInstanceReturns backed-up PostgreSQL instances. cmdlet.

VEPSQLInstance

True

0

True (ByValue)

LinuxCredentials

Specifies Linux credentials that the cmdlet will use to connect to the Linux machine.

Accepts the VEPSQLLinuxCredential object. To get this object, run the New-VEPSQLLinuxCredentialCreates a Linux credential record to connect to a target PostgreSQL server. cmdlet.

VEPSQLLinuxCredential

False

Named

True (ByValue)

Port

Specifies the port to connect to the published PostgreSQL instance.

Int32

False

Named

False

ServerName

Specifies DNS name or IP address 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 this port to connect to the Linux machine.

Default: 22

Int32

False

Named

False

ToPointInTimeUTC

Specifies a point in time in the UTC format within the 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

WindowsCredentials

Specifies Windows credentials that the cmdlet will use to connect to the Windows machine.

Accepts the PSCredential object. To get this object, run theGet-Credential cmdlet.

PSCredential

False

Named

True (ByValue)

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About Common Parameters section of Microsoft Learn.

Output Object

The cmdlet returns the VEPSQLInstancePublish[] array that contains information about the publishing process for the PostgreSQL instance.

Examples

Start-VEPSQLInstancePublishExample 1. Publishing PostgreSQL Instance to Linux Machine

This example shows how to publish a backed-up PostgreSQL instance to a Linux machine with PostgreSQL.

$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:

  1. Get the restore session:

    1. Run the Get-VEPSQLRestoreSessionReturns active restore sessions started to perform operations with backed-up PostgreSQL instances. cmdlet. Save the result to the $session variable.

      The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session. In this example, it is the first restore session in the array.

    2. Run the Get-VEPSQLInstanceReturns backed-up PostgreSQL instances. cmdlet. Set the $session variable as the Session parameter value. Save the result to the $instance variable.
  2. Get Linux credentials:

    1. Run the Read-Host cmdlet. Specify the Prompt parameter value. Provide the AsSecureString parameter. Save the result to the $securepassword variable.
    2. Run the New-VEPSQLLinuxCredentialCreates a Linux credential record to connect to a target PostgreSQL server. cmdlet. Specify the Account parameter value. Set the $securepassword variable as the Password parameter value.
  3. Run the Start-VEPSQLInstancePublish cmdlet. Specify the following settings:

    • Set the $instance variable as the Instance parameter value.
    • Set the $linuxcreds variable as the LinuxCredentials parameter value.

Start-VEPSQLInstancePublishExample 2. Publishing PostgreSQL Instance to Windows Machine

This example shows how to publish a backed-up PostgreSQL instance to a Windows machine with PostgreSQL.

$session = Get-VEPSQLRestoreSession

$instance = Get-VEPSQLInstance -Session $session[0]

$windowscreds = Get-Credential

Start-VEPSQLInstancePublish -Instance $instance -WindowsCredentials $windowscreds

Perform the following steps:

  1. Get the restore session:

    1. Run the Get-VEPSQLRestoreSessionReturns active restore sessions started to perform operations with backed-up PostgreSQL instances. cmdlet. Save the result to the $session variable.

      The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session. In this example, it is the first restore session in the array.

    2. Run the Get-VEPSQLInstanceReturns backed-up PostgreSQL instances. cmdlet. Set the $session variable as the Session parameter value. Save the result to the $instance variable.
  2. Run the Get-Credential cmdlet to create a credential object. Enter credentials that will be used for authenticating to the target PostgreSQL machine. Save the result to the $credential variable.
  3. Run the Start-VEPSQLInstancePublish cmdlet. Specify the following settings:

    • Set the $instance variable as the Instance parameter value.
    • Set the $windowscreds variable as the WindowsCredentials parameter value.

Page updated 2026-08-20

Page content applies to build 13.1.1.18