Backup Postgres Database on Windows

Exported on 17-Nov-2021 21:51:12

Backup Postgres Databases With AttuneOps on Windows

This Blueprint Creates A Backup For Specified MongoDB Database on Windows

Postgres is a relational database Management system. This blueprint takes the following parameter to create the Postgres backup file.

  • postgresConnectionUri: Postgres Connection URI, example: mongo://username@host:port/database
  • postgresBackupDestination: MongoDB Database backup file destination, should be a file path.
Pre-Blueprint Attune setup
  1. On the Inputs tab, create a Windows node for the host you wish to install the stack on.
  2. On the Inputs tab, create Windows credentials to connect to the host you wish to install the stack on.
Steps Involved
  • Create Postgres Backup


Name Type Script Reference Default Value Comment
Postgres Backup Destination Text postgresBackupDestination
Postgres Bin Directory Text postgresBinDirectory
Postgres Connection URI Text postgresConnectionUri
Windows Credential Windows OS Credential windowsCredential
Windows Node Windows Server windowsNode

1 - Postgres Backup

This step has the following parameters

Name Script Reference Default Value
Postgres Backup Destination {postgresBackupDestination} None
Postgres Connection URI {postgresConnectionUri} None
Postgres Bin Directory {postgresBinDirectory} None
The connection details have changed from the last step.

Login as user on node

  1. Connect via RDP
    mstsc /admin /v:Windows Node
  2. Login as user {Windows Credential}
  3. Then open a command prompt
This is a PowerShell Script make sure you run it with powershell.exe Click start menu, enter "powershell" in the search bar, then select the powersehll program
# Create Postgres Backup in the specified file
cd "{postgresBinDirectory}"
.\pg_dump.exe   {postgresConnectionUri} > "{postgresBackupDestination}"