Clean up after Data Protector IDB restore (Windows)

This is a follow-up on my post Clean up after Data Protector IDB restore which was intended for Linux/UNIX Cell Managers. It will guide you through the very same procedure to clean up after a successful IDB restore on a Windows Cell Manager. The same rules and warnings apply.

Please note: Data Protector program files and program data are installed to O:\OmniBack in this example. The default installation is C:\Program Files\OmniBack and C:\ProgramData\OmniBack.

  • Stop the services and check restored directory structure
O:\>omnisv stop
Cell Server services successfully stopped.

O:\>dir O:\OmniBack\server
Volume in drive O is OmniBack
Volume Serial Number is 261B-48D4

Directory of O:\OmniBack\server

07/02/2015 10:36 AM <DIR> .
07/02/2015 10:36 AM <DIR> ..
06/15/2015 04:46 PM <DIR> AppServer
07/02/2015 10:40 AM <DIR> db80
07/02/2015 10:37 AM <DIR> db80_restore
0 File(s) 0 bytes
5 Dir(s) 86,840,508,416 bytes free

O:\>dir O:\OmniBack\server\db80
Volume in drive O is OmniBack
Volume Serial Number is 261B-48D4

Directory of O:\OmniBack\server\db80

07/02/2015 10:40 AM <DIR> .
07/02/2015 10:40 AM <DIR> ..
06/15/2015 04:47 PM <DIR> dcbf
07/01/2015 08:46 PM <DIR> idb
07/01/2015 08:46 PM <DIR> jce
06/15/2015 09:38 PM <DIR> keystore
06/15/2015 04:46 PM <DIR> logfiles
06/15/2015 04:46 PM <DIR> meta
07/02/2015 10:36 AM <DIR> meta_2015_07_02-4_1435826212
07/02/2015 10:40 AM 13,276 mmd.ctx
06/15/2015 05:08 PM 16 mmd.id
06/15/2015 08:18 PM <DIR> msg
07/02/2015 10:36 AM <DIR> msg_2015_07_02-4_1435826212
07/02/2015 10:39 AM <DIR> pg
06/15/2015 04:46 PM <DIR> reportdb
06/15/2015 04:46 PM <DIR> smisdb
06/15/2015 04:46 PM <DIR> sqldb
06/15/2015 04:46 PM <DIR> sysdb
06/15/2015 04:46 PM <DIR> vssdb
06/15/2015 04:46 PM <DIR> xpdb
2 File(s) 13,292 bytes
18 Dir(s) 86,840,508,416 bytes free

O:\>dir O:\OmniBack\server\db80_restore
Volume in drive O is OmniBack
Volume Serial Number is 261B-48D4

Directory of O:\OmniBack\server\db80_restore

07/02/2015 10:37 AM <DIR> .
07/02/2015 10:37 AM <DIR> ..
07/02/2015 10:37 AM <DIR> idb
07/02/2015 10:37 AM <DIR> jce
07/02/2015 10:43 AM <DIR> pg
0 File(s) 0 bytes
5 Dir(s) 86,840,508,416 bytes free
  • Move the restored database in the target directory and adjust directory junctions. Please note: The name of the directory junctions might vary on your Cell Manager.
O:\>rmdir /S /Q O:\OmniBack\server\db80\idb
O:\>rmdir /S /Q O:\OmniBack\server\db80\jce
O:\>rmdir /S /Q O:\OmniBack\server\db80\pg

O:\>move /Y O:\OmniBack\server\db80_restore\idb O:\OmniBack\server\db80
O:\>move /Y O:\OmniBack\server\db80_restore\jce O:\OmniBack\server\db80
O:\>move /Y O:\OmniBack\server\db80_restore\pg O:\OmniBack\server\db80

O:\>dir O:\OmniBack\server\db80\pg\pg_tblspc
Volume in drive O is OmniBack
Volume Serial Number is 261B-48D4

Directory of O:\OmniBack\server\db80\pg\pg_tblspc

07/02/2015 10:37 AM <DIR> .
07/02/2015 10:37 AM <DIR> ..
07/02/2015 10:37 AM <JUNCTION> 16387 [O:\OmniBack\server\db80_restore\idb]
07/02/2015 10:37 AM <JUNCTION> 16445 [O:\OmniBack\server\db80_restore\jce]
0 File(s) 0 bytes
4 Dir(s) 87,235,559,424 bytes free

O:\>rmdir /Q O:\OmniBack\server\db80\pg\pg_tblspc\16387
O:\>rmdir /Q O:\OmniBack\server\db80\pg\pg_tblspc\16445

O:\>mklink /J O:\OmniBack\server\db80\pg\pg_tblspc\16387 O:\OmniBack\server\db80\idb
Junction created for O:\OmniBack\server\db80\pg\pg_tblspc\16387 <<===>> O:\OmniBack\server\db80\idb

O:\>mklink /J O:\OmniBack\server\db80\pg\pg_tblspc\16445 O:\OmniBack\server\db80\jce
Junction created for O:\OmniBack\server\db80\pg\pg_tblspc\16445 <<===>> O:\OmniBack\server\db80\jce
  • Update configuration files accordingly. For example replace all occurrences of db80_restore with db80. While looking at the idb.config file take a note of the values PGSUPERUSER and PGPORT as we need them when using the psql command.
O:\>notepad O:\OmniBack\server\db80\pg\postgresql.conf
O:\>notepad O:\OmniBack\server\db80\pg\postmaster.opts
O:\>notepad O:\OmniBack\Config\Server\idb\idb.config
  • Adjust the ImagePath registry value for the hpdp-idb service in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\hpdp-idb to reflect the previous changes

  • Additional clean up, depending on your configuration
O:\>rmdir /Q /S O:\OmniBack\server\db80_restore
O:\>rmdir /Q /S O:\OmniBack\server\db80\meta_2015_07_02-4_1435826212
O:\>rmdir /Q /S O:\OmniBack\server\db80\msg_2015_07_02-4_1435826212
O:\>rmdir /Q /S O:\OmniBack\log\server\auditing_2015_07_02-4_1435826212
  • Start the IDB, update the references to the table spaces before starting the remaining services and do basic verification
O:\>omnisv start -idb_only
The Internal database services successfully started.

O:\>omnisv status
    ProcName      Status  [PID]
===============================
    crs         : Down
    mmd         : Down
    kms         : Down
    hpdp-idb    : Active  [4136]
    hpdp-idb-cp : Active  [5528]
    hpdp-as     : Down
    omnitrig    : Down
    omniinet    : Down
    Sending of traps disabled
===============================
Status: At least one of the Cell Server processes/services is not running.

O:\>O:\OmniBack\idb\bin\psql.exe -U hpdp -h localhost -p 7112 postgres

postgres=# SELECT spcname, spclocation FROM pg_tablespace;
  spcname   |         spclocation
------------+-----------------------------
 pg_default |
 pg_global  |
 hpdpidb    | O:/OmniBack/server/db80_restore/idb
 hpjce      | O:/OmniBack/server/db80_restore/jce
(4 rows)

postgres=# UPDATE pg_tablespace SET spclocation = 'O:/OmniBack/server/db80/idb' WHERE spcname = 'hpdpidb';
UPDATE 1
postgres=# UPDATE pg_tablespace SET spclocation = 'O:/OmniBack/server/db80/jce' WHERE spcname = 'hpjce';
UPDATE 1

postgres=# \q

O:\>omnisv start
Cell Server services successfully started.

O:\>omnidbcheck -extended
Check Level             Mode                    Status
===========================================================
Database connection     -connection             OK
Schema consistency      -schema_consistency     OK
Datafiles consistency   -verify_db_files        OK
Database consistency    -database_consistency   OK
Media consistency       -media_consistency      OK
SIBF(readability)       -sibf                   OK
DCBF(presence and size) -bf                     OK
OMNIDC(consistency)     -dc                     OK
DONE!

O:\>omnib -idb_list IDB_BACKUP
[Normal] From: BSM@windows.syncer.de "IDB_BACKUP" Time: 7/2/2015 11:15:17 AM
Backup session 2015/07/02-5 started.

[Normal] From: BSM@windows.syncer.de "IDB_BACKUP" Time: 7/2/2015 11:15:17 AM
OB2BAR application on "windows.syncer.de" successfully started.

[Normal] From: OB2BAR_POSTGRES_BAR@windows.syncer.de "DPIDB" Time: 7/2/2015 11:15:18 AM
Checking the Internal Database consistency

[Normal] From: OB2BAR_POSTGRES_BAR@windows.syncer.de "DPIDB" Time: 7/2/2015 11:15:19 AM
Check of the Internal Database consistency succeeded

[Normal] From: OB2BAR_POSTGRES_BAR@windows.syncer.de "DPIDB" Time: 7/2/2015 11:15:19 AM
Putting the Internal database into the backup mode finished

[...]