Source:PostgreSQL Restore

From SEPsesam
Revision as of 08:55, 19 May 2017 by Sta (talk | contribs) (Added links.)

Copyright © SEP AG 1999-2024. 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. For previous documentation version(s), check PostgreSQL archive.


Overview

The restore of virtual machines (VMs) is quite similar to a regular file system restore. A restore operation offers the possibilities to execute with or without (no) recover. 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.

Restoring a PostgreSQL virtual machine

Create a new restore task for the VM 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 save sets 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 save sets matching your query, click the version you want to restore. Click Next.
  5. PostgreSQL restore select task.png


  6. Review your restore task configuration and set additional restore options in the final Save and Start step of the wizard.
    • Under the Target Path Settings, select one of the following options:
      • Restore to the 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 files the target database will be deleted first and a new one will be created from the backup save set.
      • 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 files (set by default): The database will not be restored if it already exists on the set target.
      • overwrite existing files: If the database exists on the target server, it will be replaced by the restored version.
      • Auto recover 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
    
    PostgreSQL restore save.png


  7. If you want to start your database 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.

Restoring single databases (DBs)

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

See also

PostgreSQL Backup