There are many different methods that one can use for protecting PostgreSQL. This time we are going to introduce you to the pgbackrest utility.

  1. Install the IBM Spectrum Protect Client API

2. Install the SPFS software

3. Configure the Spectrum Protect client

4. Register the node on the backup server

5. Configure the SPFS file system

5.1 Create option file

5.2 set initial password

5.3 Create spfs configuration

6. mounting the SPFS file system

You are now ready to start using Spectrum Protect as a file system, storing and retrieving backup data of PostgreSQL

Performing backup using pgbackrest

https://pgbackrest.org/

The configuration of PgBackRest is very easy, it consists of a configuration pgbackrest.conf file that must be edited. In my case the file is located in /etc. As specified, we will use a very basic configuration file.
Below the contents of my configuration file
A complete list can be found here

[root@pgserver etc]# cat pgbackrest.conf 
[global]
repo-path=/var/lib/pgbackrest
[clustpgserver]
db-path=/var/lib/pgsql/10/data
retention-full=2
[root@pgserver etc]#

In the file above,
• repo-path is where backup will be stored,
• clusterpgserver is the name of my cluster stanza (free to take what you want as name). A stanza is the configuration for a PostgreSQL database cluster that defines where it is located, how it will be backed up, archiving options, etc.
• db-path is the path of my database files
• retention-full : configure retention to 2 full backups
A complete list can be found here

[root@pgserver etc]# cat pgbackrest.conf 
[global]
repo-path=/var/lib/pgbackrest
[demo]
db-path=/var/lib/pgsql/10/data
retention-full=2
[root@pgserver etc]#

Create the stanza

$ pgbackrest — stanza=demo — log-level-console=info stanza-create

Check configuration

$ pgbackrest --stanza=demo --log-level-console=info check

Example of backing up the instance

$ pgbackrest — stanza=demo — log-level-console=info backup

Restoring from a backup

$  pgbackrest --stanza=demo--log-level-console=info restore

Follow us on Twitter: http://twitter.com/spictera
Follow us on LinkedIn: http://LinkedIn.com/company/spictera

--

--

spictera world class leader in Data Protection

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store