Restoring the PostgreSQL Server

When the PostgreSQL Server is corrupted or lost, you can restore and recover it from the latest full backup. Both the data and the logs can be restored using the FSBasedBackupSets.

If you are using PostgreSQL version 12 or later, follow the steps mentioned in Consideration for Restoring FSBased Backup Set on PostgreSQL 12 and later.

Before You Begin

Restore the File System backups of same version of PostgreSQL and not from higher to lower or lower to higher.

Procedure

  1. From the CommCell Browser, navigate to Client > PostgreSQL > Instance.

  2. Right-click FSBasedBackupSet, and then click All Tasks > Browse and Restore.

  3. Click View Content.

  4. Select the data that you want to restore and click Recover All Selected.

    The PostgreSQL Database Restore Options dialog box appears.

  5. Select Restore in place. Click Next.

    By default, the server is restored to the data directory path according to the source data directory path. Port information and archive log directory information are obtained from the destination instance.

  6. For PostgreSQL clients with Indexing version 2, complete the additional information:

    1. In the Number of Streams box, enter the number of streams to use in the restore operation.

      By default, the number of streams is set to 2.

    2. To clean up data, tablespace, and archive log directories before performing the restore operation, select the Cleanup old directories check box.

      If you do not select the Cleanup old directories check box, stop the PostgreSQL server and delete or rename the data directory, user tablespace directory, archive log directory, and transaction log directory that is outside the data directory.

    3. To start the PostgreSQL Server, in the Custom start command box, enter the command.

      Examples:

      • On a RHEL computer, enter the systemctl start postgresql-15 custom command to start PostgreSQL as a service.

      • On a Window Server 2012 R2 computer, enter the sc start postgresql-x64-13 custom command to start PostgreSQL as a service.

        Note

        If you leave the Custom start command box empty, the Commvault software uses the pg_ctl command to start the PostgreSQL Server.

  7. Clear the Recover Database Server check box in the following two scenarios:

    • If you do not want the PostgreSQL Server to start automatically after the restore operation is complete.

    • If you are restoring an instance that has a UNC path as its Archive Log Directory. After the restore is complete, you can start the PostgreSQL Server manually.

  8. Click OK.

Loading...