4 4 3:PostgreSQL Restore

From SEPsesam
Jump to: navigation, search
Other languages:
Deutsch • ‎English
Copyright © SEP AG 1999-2020. All rights reserved.

Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.

Docs latest icon.png Welcome to the latest SEP sesam documentation version 4.4.3/4.4.3 Beefalo V2. For previous documentation version(s), check PostgreSQL archive.


Overview

The restore of PostgreSQL database(s) is quite similar to a regular file system restore. It is possible to restore the PostgreSQL databases to the original or to a new location. Restore is triggered from the Menu bar -> Activities -> Restore. Restore wizard guides you through the process of restoring your data. For step-by-step procedure, see Standard Restore Procedure.

Note that SEP sesam provides the web Restore Assistant interface which is designed to be more intuitive and offers additional advanced options compared to GUI restore wizard while, on the other hand, it does not support the restore of special tasks types, such as MS SQL, PostgreSQL, Oracle, etc. For these task types you can only use the GUI restore wizard to restore your data.

Restoring PostgreSQL

Create a new restore task for the PostgreSQL saveset you want to restore.

  1. From the SEP sesam GUI menu bar, select Activities -> Restore. The New Restore Task window opens.
  2. Select what you want to restore. You can search savesets by task name or by filename or path.
  3. Under the Saved in period drop-down lists, specify the time frame for which you want to conduct the search. Click Next.
  4. The search results are displayed. From the list of savesets matching your query, select the version you want to restore. Click Next.
  5. PostgreSQL restore select task Beefalo V2.jpg

  6. Under the Target Settings, set additional options.
    • Under the Target path settings, select one of the following options:
      • Restore to original target path (set by default): Restores the data to the same location from which it was backed up. If it is set together with the option Overwrite existing items the target database will be deleted first and a new one will be created from the backup saveset.
      • If you select the option New restore target and enter a new database name, the PostgreSQL command createdb creates a database with the specified name. The data is imported into the new database.
      • Information sign.png Note
        You have to set up database users and roles before the database is imported to new target.
    • Under the Execution options drop-down list, select one of the following options:
      • Do not overwrite existing items (set by default): The database will not be restored if it already exists on the target server.
      • Overwrite existing items: If the database exists on the target server, it will be replaced by the restored version.
      • Auto recover (and online) after restore: The data will be stored directly into the database without caching in the file system. Because the data is written directly into the database, it is not possible to modify it.
      • No recover after restore: Use this option if you want to modify the data before you import it into the database. The restored data will be stored on the file system first. The import of data has to be started on the command line interface of the server's operating system. The data will be written as a dump file onto the file system (usually in the directory <SESAM_VAR>/work). You can use this file as input file for the PostgreSQL program pg_restore as follows:
      • su - postgres
        pg_restore template1 -C /var/opt/sesam/var/work/pgsql-SF20081128224529.tmp
        
    • Click the Expert Options button if you want to specify additional restore settings, e.g., modify the log level, define the pre/post script for restore, etc. For details, see the Restore wizard.
    • Information sign.png Note
      As of v. 4.4.3. Beefalo, the Expert Options button for specifying advanced restore options is only available in the Expert UI mode. It is not available for users that run the GUI in Basic or Advanced mode. In the latter case, if you want to access the Expert Options you first have to change the Basic/Advanced UI mode to Expert, as described in Selecting UI mode.

    PostgreSQL restore target Beefalo V2.jpg

  7. In the final step of the restore wizard, you can review all the settings of your restore task. You can also edit the settings by using Change Selection button. If you want to start your restore immediately, click Start. If you want to save the restore task, click Save.

A restore task can be scheduled like any other task. If you want to add a restore task to the schedule, see Scheduling Restore.

You can view the status of your restore jobs by selecting Job state -> Restores from the Main Selection. Restore overview provides detailed information on the last run of restore jobs, including the task name, status (successful, error, in queue ...), start and stop time of the last backup, data size, throughput, client and message.

As of 4.4.3 Beefalo V2, you can also monitor the restore progress using the Web UI. For details, see SEP sesam Web UI.

Restoring a single database (DB)

To be able to restore a single DB from a PostgreSQL server, you have to create a separate backup task for each PostgreSQL DB. If the PostgreSQL source in the backup task is set as all, you cannot restore an individual database. For details, see PostgreSQL Backup.

Information sign.png Note
In case of errors during the restore (e.g., primary key error), the restore status in the SEP sesam GUI/Web UI is displayed as erroneous. In such case, check the restore protocol and the data in the database.

Known issues

If you have problems with PostgreSQL, check the Troubleshooting Guide.