Recovering Databases

This page describes the procedure for restoring Dispatcher Paragon databases. Dispatcher Paragon uses the main databases for its basic operation which are named SQDB6 and SQDB6_IMS. If Dispatcher Paragon Payment System is installed, the database SQDB6_YPS is also part of Dispatcher Paragon. For recovering a database, please follow the instructions below according to the database type used.

Preparation

Stop Almost All Dispatcher Paragon Services in the Whole Environment

Dispatcher Paragon services need to be stopped before a database restore is performed and the cache on Spooler Controllers needs to be cleared before they are started again to avoid possible inconsistencies.

  1. Stop almost all Dispatcher Paragon services on the Management and Site Servers:

    1. Leave only these two Dispatcher Paragon services running:

      1. Dispatcher Paragon Bundled Etcd

      2. Dispatcher Paragon Bundled PostgreSQL 9.4 (available if embedded PostgreSQL DB is used)

    2. You can use the following PowerShell script to perform the task:

      Get-Service *YSoft* | Where-Object {$_.Name -ne 'YSoftPGSQL' -and $_.Name -ne 'YYSoftPGSQL' -and $_.Name -ne 'YSoftEtcd'} | Stop-Service

Recovering PostgreSQL

All restore procedures should be consulted first with the Database Administrator/Owner in case an external PostgreSQL database is used.

Please note that this is just a quick guide to the pgAdmin tool. The latest documentation is always available on PostgreSQL's web pages.

Please check that the current backup files are available before you start with the restore procedures.

Deleting the Current Dispatcher Paragon Databases

  1. On the database server, run the pgAdmin administration tool.

  2. In the Object browser window, double-click the SafeQ PostgreSQL server connection item and connect to the server.

  3. Delete the current SafeQ databases:

    1. SQDB6

      images/download/attachments/153630696/PGdelete.png

    2. SQDB6_IMS

    3. SQDB6_YPS (if Dispatcher Paragon Payment System is installed)

Creating New Databases

  1. Right-click Databases > New Database...
    images/download/attachments/153630696/PGcreatenew.png

  2. Create new databases with Owner set to postgres using the same names as the original ones:

    1. SQDB6

      images/download/attachments/153630696/PGcreatenew2.png

    2. SQDB6_IMS

    3. SQDB6_YPS (if Dispatcher Paragon Payment System is installed)

Restoring the Databases from Backup

  1. Restore the SQDB6 database from a backup file:

    1. Right-click the database name and select the Restore... option.

      images/download/attachments/153630696/PGrestore.png
    2. Select your backup file.

      images/download/attachments/153630696/PGrestore2.png

    3. Click Restore.

    4. The backup will be restored.

    5. Restoration must end with Error code 0.

      images/download/attachments/153630696/PGrestore3.png

  2. Restore the SQDB6_IMS database from a backup file.

  3. Also restore the SQDB6_YPS database from a backup file (if Dispatcher Paragon Payment System is installed).

Reconfiguring the SQDB6 Database

Run the following procedure on the SQDB6 database:

SELECT cluster_mngmt.spu_recover_tenant_db_passwords();

Re-validating the Database

  1. Run the following procedure on the SQDB6 database:

    SELECT cluster_mngmt.spu_clean_validator_tables();
  2. Run DB Validator Tool.

  3. Continue with the Finalization section.

Recovering MS SQL

All restore procedures should be consulted first with a Database Administrator/Owner.

Please note that this is just a quick guide for MS SQL Studio. The latest documentation is always available on Microsoft's web pages.

Please check that current backup files are available before you start with the restore procedures.

Deleting the Current Dispatcher Paragon Databases

  1. On the database server, run Microsoft SQL Management studio.

  2. Click File - Connect to Object Explorer.

  3. Choose a Database engine as a Server type and connect to the database server.

  4. In the Object Explorer (menu on the left), click Databases.

  5. Delete current SafeQ databases:

    1. SQDB6

      images/download/attachments/153630696/MSdelete.png

    2. SQDB6_IMS

    3. SQDB6_YPS (if Dispatcher Paragon Payment System is installed)

Creating New Databases

  1. Right-click Databases > New Database...

  2. Create new databases with the same names as the original ones:

    If you are using domain users, create the databases according to the article Installing Dispatcher Paragon Management Server on external MSSQL using domain users.

    1. SQDB6

    2. SQDB6_IMS

    3. SQDB6_YPS (if Dispatcher Paragon Payment System is installed)

Restoring Databases from Backup

  1. Restore the SQDB6 database from a backup file.

    1. Right-click the database name and select Tasks > Restore > Database... option.

      images/download/attachments/153630696/MSrestore.png

    2. Switch source to Device and select your backup file > enable the checkbox in the Restore column.

      images/download/attachments/153630696/MSrestore2.PNG

    3. Navigate to the Options page.

      1. Check the Overwrite the existing database (WITH REPLACE) option.

      2. Uncheck the Take a tail-log backup before restore option.

        images/download/attachments/153630696/MSrestore3.PNG

    4. Click OK.

    5. Backup will be restored.

      images/download/attachments/153630696/MSrestore4.PNG

  2. Restore the SQDB6_IMS database from a backup file.

  3. Also restore the SQDB6_YPS database from a backup file (if Dispatcher Paragon Payment System is installed).

  4. Run the following query:

    ALTER USER [cluster_mngmt] WITH LOGIN = [cluster_mngmt];
    ALTER USER [cluster_guest] WITH LOGIN = [cluster_guest];
  5. If you do not use sa user, also run the following query:

    ALTER USER [<safeq_user>] WITH LOGIN = [<safeq_user>];

    Replace <safeq_user> in both places with the value of the database.global.management.username.without.domain property from the DispatcherParagon installation directory\Management\conf\safeq.properties file.

Reconfiguring the SQDB6 Database

Run the following procedure on the SQDB6 database:

EXEC cluster_mngmt.spu_recover_tenant_db_passwords;

Re-validate database

  1. Run the following procedure on the SQDB6 database:

    EXEC cluster_mngmt.spu_clean_validator_tables;
  2. Run DB Validator Tool

Finalization

Clear the Cache on Spooler Controllers and Restart All Services

Cache on Spooler Controllers needs to be deleted after Database restore to avoid possible inconsistencies.

Delete Dispatcher Paragon Spooler Controller cache directory on all servers

Delete Dispatcher Paragon Spooler Controller cache by deleting whole folder <SAFEQSPOC_DIR>\SpoolCache (e.g. c:\DispatcherParagon\SPOC\SpoolCache)

Start Dispatcher Paragon Management service again

Open the Services window (e.g. Start > Run > services.msc) and start the following services:

  1. Start Dispatcher Paragon Management Service

Verify the Dispatcher Paragon Spooler Controller cache recovery settings

Go to tab System > Configuration on Dispatcher Paragon Management web interface and set orsCacheRecovery property to enabled.

In case of Dispatcher Paragon Spooler Controller cache data corruption, cache can be manually deleted and all job-related metadata will be recovered from Dispatcher Paragon Management Server.

If you omit this step, all jobs stored on the Dispatcher Paragon Spooler Controller might be lost after the end of procedure.

Start the remaining Dispatcher Paragon services on all servers

Do not start Dispatcher Paragon Spooler Controller Group Service manually. If Dispatcher Paragon Spooler Controller is part of Spooler Controller group then this service will start automatically when its configuration is ready.

  1. Start remaining Dispatcher Paragon services with Automatic startup type in no particular order

You can use the following PowerShell script to perform the task:

Get-Service *YSoft* | Where-Object {$_.Name -ne 'YSoftSQ-SPOCGS'} | Start-Service

Verify the correct Dispatcher Paragon Spooler Controller functionality

Once the Dispatcher Paragon Spooler Controller cache is deleted and Dispatcher Paragon Spooler Controller services are running, verify the correct Dispatcher Paragon Spooler Controller functionality according to the article Dispatcher Paragon Spooler Controller Health Check.