Description
This page provide ways to restore CSS / PostgreSQL schema on your CSS / PostgreSQL database server.
There are 3 ways to restore CSS / PostgreSQL schema:
Applicable in CAST Version
Release | Yes/No |
---|---|
8.3.x | |
8.2.x | |
8.1.x | |
8.0.x | |
7.3.x | |
7.2.x |
Using CSS Restore
Using CSS Restore
- Restore the database using the CSSRestore.exe command. Refer to the page CAST Storage Service - Maintenance activities section Restoring a backed up CAST schema for more informations.
- The command line is:
<CAST INSTALLATION FOLDER>\CSSADMIN>CSSRestore.exe -schema <schema_name> -host <HOST> -port <PORT> -password <CSS_Operator_password> -file <path_and_name_of_backup_file.cssdmp> -log <path_and_name_of_log_file.log>
Example:
C:\Program files\CAST\8.3\CSSADMIN>CSSRestore.exe -schema m833_tkb_support -host CSS2SUP02.*****.*********.com -port ****** -password CastAIP -file "C:\*********\support_app_mngt.cssdump" -log "C:\Support\Restore\TKB\m833_tkb_support_restore.log"
Using pg_restore
Using PG_RESTORE
Check that the database you are going to restore does not exist by running the following command:
C:\Program Files\CAST\CASTStorageService2\bin\pg_restore.exe -l "<path to the folder>\file.backup >%temp%\metadata_file.txt
For Example:
C:\Program Files\CAST\CASTStorageService2\bin\pg_restore.exe -l "C:\temp\backup\tkb_dump_mngt.backup >%temp%\metadata_file.txt
Open %temp%metadata_file.txt, search for schema name and compare it with existing schema on the server.
Restore the database using the pg_restore.exe command. Refer to the page PG_RESTORE.
<CAST STORAGE SERVICE Installation Folder>\bin\pg_restore.exe --host <Database Server> --port <port> --username "operator" --dbname postgres --verbose "<path to the folder>\<backup name>"
The command line would be like:
"C:\Program files\bin\pg_restore.exe" --host CSS2SUP02.*****.**********.com --port ****** --username "operator" --dbname postgres --verbose "C:\Temp\MyBackup\tkb_support_mngt.backup"
Rename the schema that has been restored by running the following query:
Alter schema <schema_name> rename to <new schema name>
For example:
Alter schema my_tkb_mngt rename to cb833_application_mngt
Using PGADMIN3
Using PGADMIN3
- Open PGAdmin3
- Connect to the Database Server where you are going to restore the database
- Expand the Database server
- Right click postgres
- Select Restore
- Select the schema backup to restore
- Click Restore
Rename the schema that has been restored by running the following query:
Alter schema <schema_name> rename to <new schema name>
For example:
Alter schema my_tkb_mngt rename to cb833_application_mngt