Restore Postgres Database on Linux

Exported on 17-Nov-2021 22:03:41

Restore Postgres Databases With AttuneOps on Linux

This Blueprint Restores A Backup For Specified MongoDB Database on Linux

Postgres is a relational database Management system. This blueprint takes the following parameter to restore 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
  • Restore Postgres Backup


Name Type Script Reference Default Value Comment
Linux Linux / Unix Server linux
Linux Credential Linux OS Credential linuxCredential
Postgres Backup Destination Text postgresBackupDestination
Postgres Connection URI Text postgresConnectionUri

1 - Restore Postgres Database

This step has the following parameters

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

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Create a backup file for Postgres Database
psql {postgresConnectionUri} < {postgresBackupDestination}