# Restoring a PostgreSQL Instance to a Different Host (Out-of-place)

You can restore a PostgreSQL instance to a different host (out-of-place).

## Prerequisites

If you use a custom socket directory, specify the port using the format: SOCKET_DIR_PATH:PORT. You may list multiple socket directories separated by commas before the colon.

For example:

Single directory: /var/run/postgresql:5432

Multiple directories: /var/run/postgresql,/tmp,/etc/pgsql:5432

## Before You Begin

Check whether you meet the following requirements:

- The source and destination clients have the same major version of PostgreSQL Server.

- Data directory path and tablespace location in the source and the destination clients are the same.

- PostgreSQL Agent and MediaAgent are installed on the destination client.

- 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.

## Procedure

1. From the Command Center navigation pane, go to Protect > Databases.

   The database Overview page appears.

2. Go to the Instances tab.

3. In the row for the instance, click the action button , and then click Restore.

   Alternatively, click the instance you want to restore, and then in the Recovery points tile, select FSBasedBackupSet, then click Restore.

   The Backup content page appears.

   Note

   Ensure that you have performed a successful backup on the selected date.

4. Select the database and click Restore.

   The Restore options dialog box appears.

5. Select Out of place option.

6. From the Restore type list, you can select the following restore types:

   - Cross instance restore

   - Restore to disk

7. If you select Cross instance restore, do the following:

   1. From the Destination Client list, select the destination server for the restore.

   2. From the Destination instance list, select the destination instance for the restore.

   3. In the Number of streams box, enter the number of streams that are applicable for snapshot or backup copy restores.

   4. Select the Cleanup old directories check box to clean up data, tablespace, and archive log directories before performing the restore.

      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.

   5. The Recover Database Server is checked by default.

      Clear the Recover Database Server check box if you do not want the PostgreSQL Server to start automatically after the restore operation is complete.

   6. In the Start server command box, enter the command to start the PostgreSQL server.

   7. Select the Redirect checkbox to redirect the restored files to another location.

8. If you select Restore to disk, do the following:

   1. From the Destination Client list, select the destination server for the restore.

   2. Select the time duration using the From time and to time calender.

   3. From the Job(s) drop-down list, select an existing job to restore.

   4. In the Destination folder, enter the destination folder path.

   5. Move the Impersonate user toggle key to right to use a different account than the one that is configured for the PostgreSQL instance

   6. Check the Restore transaction logs only check box if you only want to restore transaction log files.

9. Under Advanced options section, perform the following actions:

   - Under the Pre or Post options, do the following:

     - In the Pre recovery command box, enter the name or path of the process to run before the restore.

     - In the Post recovery command box, enter the name or path of the process to run after the restore.

     - If you want to initiate the restore as user, move the Run as User toggle button to right.

       In the User name box, enter a user name you want to run the restore with.

   - Under the Data path, do the following:

     - From the Server name drop-down list, select a media agent server name.

10. To send a notification email when the restore job completes, select the Notify user on job completion.

11. You can configure a schedule to repeat this restore operation. To create a schedule, do the following:

    1. Click Schedule.

       The Add schedule dialog box appears.

    2. In the Name box, type a name for the schedule.

    3. Configure the Frequency and Repeat parameters.

    4. To specify exceptions to the schedule, click Exceptions.

       The Exceptions dialog box appears.

    5. Configure the exception parameters:

       - You can click Add Exception to save a set of exception parameters and continue adding sets of exception parameters.

       - Click Save when you have finished configuring the exception parameters.

    6. Under the Range of recurrence section, specify the Start date and End date to schedule the recurrence range of the restore operation.

    7. To save the schedule and return to the restore dialog box, click Schedule.

12. Click Submit.

## Related Topic

Viewing and Editing Database Restore Schedule.

×

Loading...