Top
Enterprise Postgres 17 Operation Guide

5.7 Backing Up and Restoring/Recovering the Database

Fujitsu Enterprise Postgres enables you to use the five backup and recovery methods described below. Regardless of the method you use, you must back up the keystore at the same time.

Note that you must store the database and the keystore on separate data storage media. Storing both on the same data storage medium risks the danger of the encrypted data being deciphered if the medium is stolen.

Backup and recovery using WebAdmin

Backup and recovery using the pgx_dmpall and pgx_rcvall commands

Example

  • Back up the database and the keystore on March 1, 2022.

    > pgx_dmpall -D /database/inst1
    > cp -p /key/store/location/keystore.ks /keybackup/keystore_20220301.ks

    Specify the following in the pgx_dmpall command:

    • Specify the data storage destination in the -D option. If the -D option is omitted, the value of the PGDATA environment variable is used by default.

  • Recover the database and the keystore from the backup taken on March 1, 2022.

    > cp -p /keybackup/keystore_20220301.ks /key/store/location/keystore.ks
    > pgx_keystore --enable-auto-open /key/store/location/keystore.ks  (Execute only when enabling automatic opening)
    > pgx_rcvall -B /backup/inst1 -D /database/inst1 --keystore-passphrase

    Specify the following in the pgx_rcvall command:

    • Specify the data storage destination in the -D option. If the -D option is omitted, the value of the PGDATA environment variable is used by default.

    • Specify the backup data storage directory in the -B option.

    • The --keystore-passphrase option prompts you to enter the passphrase to open the keystore.

Dump and restore using SQL

File system level backup and restore

Continuous archiving and point-in-time recovery

See

  • Refer to "pg_ctl" under "Reference" in the PostgreSQL Documentation for information on the pg_ctl command.

  • Refer to "Reference" in the PostgreSQL Documentation for information on the following commands:

    • psql

    • pg_dump

    • pg_basebackup

  • Refer to the Reference for information on the following commands:

    • pgx_rcvall

    • pgx_dmpall

    • pg_dumpall

If you have restored the keystore, repeat the process of enabling automatic opening of the keystore This ensures that the contents of the automatically opening keystore (keystore.aks) are identical to the contents of the restored keystore.

Refer to "5.6.3 Enabling Automatic Opening of the Keystore" for information on how to enable automatic opening of the keystore.