PostgreSQL Plugin: Quick Start

Enterprise

Bacula Enterprise Only

This solution is only available for Bacula Enterprise. For subscription inquiries, please reach out to sales@baculasystems.com.

The PostgreSQL Plugin is designed to simplify the backup and restore procedure of PostgreSQL clusters, so that backup administrator does not need to know about internal details of Postgres backup techniques or write complex scripts. The plugin automatically handles the backup of essential information such as configuration, users definitions and tablespace.

The PostgreSQL Plugin supports both Dump and Point-In-Time Recovery (PITR) backup techniques.

The PostgreSQL Plugin is compatible with Copy/Migration jobs. Read Replication: Copy/Migration Jobs for more information.

Installation

The PostgreSQL Plugin for Bacula Enterprise can be installed as part of the File Daemon (FD) component. It can be installed using the Bacula Installation Manager (BIM):

../../../../_images/QSInstallation.png

The procedure includes verifying prerequisites, selecting the appropriate Bacula version, installing the desired plugins, and configuring firewall rules to ensure seamless operation.

Alternatively, it can be installed using the package manager directly.

The installation of the PostgreSQL Plugin does require the File Daemon component to be running on the same host. To install the File Daemon, visit the File Daemon installation page.

Configuration

To configure the PostgreSQL Plugin in Bweb:

  1. Click the plus icon at the bottom right corner, and select Add Job.

../../../../_images/QSConfiguration01.png
  1. Select Create in the Backup tile.

../../../../_images/QSConfiguration02.png
  1. Enter a name for the job, choose a description and select BackupsToDisk as the Job Template.

../../../../_images/QSConfiguration03.png
  1. Select the Client.

../../../../_images/QSConfiguration04.png
  1. Select a Fileset. If none was has been defined yet, click now.

../../../../_images/QSConfiguration05.png

5.1. Choose a Name and Description for the new Fileset.

../../../../_images/QSConfiguration06.png

5.2. Choose Select Paths and Files. Then, select the right Client and click on the PostgreSQL Plugin.

../../../../_images/QSConfiguration07.png

5.3. Choose a Backup Mode, the PostgreSQL User and the Database. Then, click Submit and Next.

../../../../_images/QSConfiguration08.png

5.4. Review the Fileset options and click Save.

../../../../_images/QSConfiguration09.png
  1. With the newly created Fileset selected, click Next.

../../../../_images/QSConfiguration10.png
  1. Choose the Pool Name, Messages resource and the Storage.

../../../../_images/QSConfiguration11.png
  1. Choose a Schedule and click Next.

../../../../_images/QSConfiguration12.png
  1. Verify the new job appears in the Jobs list.

../../../../_images/QSConfiguration13.png

This basic setup enables the plugin to handle PostgreSQL backups.

For detailed configuration options and advanced settings, refer to the official documentation: PostgreSQL Plugin Configuration Guide.

For learning about Bacula’s basic operations, visit: Guide to Basic Operations.

Backup Example

  1. Click Run Backup, and in Step 1, select the previously defined Job from the drop-down menu.

../../../../_images/QSBackupExample01.png ../../../../_images/QSBackupExample02.png
  1. Review the Job Report after the Job has completed.

../../../../_images/QSBackupExample03.png
  1. You can verify data, check the termination status or restore using the information dialog.

../../../../_images/QSBackupExample04.png

Congratulations, you have successfully run a PostgreSQL Database backup job.

Restore Examples

Case 1

Restore SQL files containing commands required to restore your Database.

  1. In the left menu, go to Databases and click the Restore icon at the bottom.

../../../../_images/QSRestoreExample01.png
  1. Click Run Restore.

../../../../_images/QSRestoreExample02.png
  1. Review the Job Report with the Job termination status.

../../../../_images/QSRestoreExample03.png
  1. The instruction files for restoring the database will be located in the /tmp/bacula-restores/ folder.

../../../../_images/QSRestoreExample04.png

Case 2

Restore to a new Database.

  1. In the left menu, go to Databases and click the Restore icon at the bottom.

../../../../_images/QSRestoreExample05.png
  1. In the Postgresql tab, choose a new database name, and click Run Restore.

../../../../_images/QSRestoreExample06.png
  1. Tables will be recreated, and the Job Report will display the backup status once the Job has completed.

../../../../_images/QSRestoreExample07.png ../../../../_images/QSRestoreExample08.png ../../../../_images/QSRestoreExample09.png

Congratulations, you have successfully restored your database!

Go back to: PostgreSQL Plugin.