PostgreSQL database backup

This article explains how to configure the PostgreSQL database environment in Xopero ONE.

In Xopero ONE, you can back up a variety of databases, including Oracle, MySQL, Microsoft SQL, and PostgreSQL.


Prerequisites

To maintain data consistency, Xopero recommends using a dedicated backup type: a file-based backup with a pre-backup script for the PostgreSQL database.

Database backup begins with a script that requests the database server to create a dump in a temporary directory. Once the dump is complete, Xopero ONE backs up the generated dump file.

Xopero ONE uses the pg_dump utility to back up PostgreSQL databases.


Backup configuration

1

Log in to , go to the Backup tab (Plans > Backup) and click the + Add plan button in the top toolbar.

2

Select Devices from the platforms list.

3

In the next aside, select one of the available options and choose one or more devices for the plan to apply to (you can also select the plan to include all activated devices).

4

Define the name of the backup plan.

5

Configure your backup plan according to your needs (more information about the backup plan setup can be found in File-level backup and Image-level backup articles).

6

Go to the Advanced settings section and click Edit to customize additional options.

7

Scroll down to the Backup scripts section and click the Pre-task script toggle to turn it on.

8

Select the script dedicated to backing up the PostgreSQL database environment.

9

Type your database username into the Database user field.

10

Choose the user password by opening the Password Manager, where you can either add a new password or select an existing one.

11

Set up the script arguments — it should be entered in the Script arguments field as follows:

database output_dir "pg_dump_dir" port_number
  1. database — the name of the database to back up. A backup plan can target a single database or all databases. To back up all databases, use the --all parameter instead of specifying a database name.

  2. output_dir — the directory where the database dump will be created; this is also the folder that Xopero ONE will back up.

  3. pg_dump_dir — the path to the pg_dump utility. This is required only for PostgreSQL databases hosted on Windows.

  4. port_number — required only if your PostgreSQL server uses a non-standard port (other than 5432).

12

You can enable the two additional options using the checkboxes:

  1. Wait for the script to continue the task — the application will wait until the dump is ready.

  2. Fail the task if the script fails — if the script fails, the system will notify you of the backup error.

13

Double-check your settings and click Save to close the Advanced settings aside.

14

After completing the configuration, click the Save button. The protection plan will then automatically begin protecting your devices and databases according to the schedule you defined.


File-level backup recoveryFile-level backupRestoring PostgreSQL database

Last updated