4 4 3:PostgreSQL Restore
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.
- From the SEP sesam GUI menu bar, select Activities -> Restore. The New restore task window opens.
- Select what you want to restore. You can search save sets by task name or by filename or path.
- Under the Saved in period drop-down lists, specify the time frame for which you want to conduct the search. Click Next.
- The search results are displayed. From the list of save sets matching your query, click the version you want to restore. Click Next.
- 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.
- 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:
|You have to set up database users and roles before the database is imported to new target.|
su - postgres pg_restore template1 -C /var/opt/sesam/var/work/pgsql-SF20081128224529.tmp
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.
|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.|
If you have problems with PostgreSQL, check the Troubleshooting Guide.