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(tick) 
8.2.x (tick) 
8.1.x(tick)
8.0.x (tick)
7.3.x(tick)
7.2.x(tick)
Using CSS Restore

Using CSS Restore 

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

  1. 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 
  2. Open %temp%metadata_file.txt, search for schema name and compare it with existing schema on the server.

  3. 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>"
  4. 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"
     
  5. 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 

  1. Open PGAdmin3
  2. Connect to the Database Server where you are going to restore the database
  3. Expand the Database server
  4. Right click postgres
  5. Select Restore
  6. Select the schema backup to restore
  7. Click Restore
  8. 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