Restoring and Upgrading the History Database

Scenario: You have an HDB backup that you want to restore. The HDB backup can be of the same version as that of the current SQL Server version or it can have the lower version. For information on restoring and upgrading the notification database, see Restoring and Upgrading the Notification Database (NDB).

In case of the same version, once the HDB backup is restored you can directly link it to the project (proceed to step 5).

If the HDB that you are about to restore has the lower version than that of the current SQL Server version, then after restore you must first stop the HDB, upgrade it to the version of the SQL Server, start the HDB and thereafter link it to the project.

 

Reference: For background information, see the reference section.

 

Workflow diagram:

 

 

Prerequisites:

  • The Windows user configured in the System Account and in the HDB Service Account must be valid and assigned all required rights, See Log on as a Service Right in System Settings Procedures.
  • SMC must be launched, the following prerequisites apply :
    • The required Windows account configured on SQL Server with sysadmin fixed server role is available.
    • If the required privileges are not available a dialog box appears to provide a Windows account configured on the SQL Server with sysadmin fixed server role.
    • SMC launched with a Windows HDB owner user when HDB workflow do not need system administrator privileges.
    • HDB workflows such as change HDB owner, which need system administrator privileges, a dialog box displays to provide a user having system administrator privileges on the SQL Server.
  • A HDB backup is available at the known path.

Steps:

1 – Restore an HDB Backup
  • SQL Server or SQL Server Express is available.
  • A named instance is available on the SQL Server.
  1. In the SMC tree, select Database Infrastructure > [SQL Server Name].
    NOTE: Do not select an existing History Database.
  1. Click Restore and select Restore History Database from the displayed options.
  1. Select the Database Information expander and type a new DB Name (no special characters or spaces).
  1. Select the Files and Paths expander and type the following data:
  • Data file: D:\[MyProjectHDB]\HDB.mdf
  • Log file: E:\[MyProjectHDB]\HDB.ldf
  • Backup file: F:\[MyProjectHDB]\HDB.bak
  • Recovery log path: E:\[MyRevoveryPath]
  • Restore file: F:\[MyProjectHDB]\HDB.bak
  1. Select the Security expander and check the displayed user names.
    a. DB owner: Desigo CC SMC user who requires HDB owner rights. You can change it as required. The HDB owner must be different than the HDB user and the HDB service user.
    b. DB user: Desigo CC project user who requires HDB user rights for read and write operations. You can change it as required in System Account Settings. See Settings Expander in SMC System Settings.
    c. DB service user: Desigo CC service user who requires HDB service user rights for maintenance operations. You can change it as required in HDB Service Account Settings. See Settings Expander in SMC System Settings.
  1. Click Save .
  1. Click Yes to restore a backup file.
  • The History Database is read back and displayed in the SMC tree. The HDB status is seen as outdated if the restored HDB needs an upgrade.
  • The History Database is started automatically following successful restore.

 

2 – Stop an HDB

You need to stop the restored and started HDB to proceed with HDB upgrade.

  • The HDB status is seen as Outdated.
  • The History Database is started.
  1. In the SMC tree, select Database Infrastructure > [SQL Server Name] > [History Database name].
  1. Click Stop Automatic Maintenance .
  • The History Database is stopped. No more maintenance activities are performed on the database. So, make sure that the HDB is always started or else there is a possibility of data loss.

 

3 – Upgrade an HDB

The History Database must be upgraded for a new version. The following workflow illustrates the preconditions and different variants for upgrading the History Database.

  • SMC is launched with a Windows account configured on the SQL Server with sysadmin fixed server role. If the required privileges are not available a dialog box appears to provide a Windows account configured on the SQL Server with sysadmin fixed server role.
  • The HDB status is seen as follows:
    Outdated: The database needs to be upgraded.
    Outdated - Resolve conflicts before upgrade: The database needs to be upgraded but before upgrade the HDB owner must be changed to a user other than the HDB user and the HDB service user.
  1. Select the Security expander and check if the displayed user names are as required.
    a. DB owner: Desigo CC SMC user who requires HDB owner rights. You can change it as required. The HDB owner must be different than the HDB user and the HDB service user.
    b. DB user: Desigo CC project user who requires HDB user rights for read and write operations. You can change it as required in System Account Settings. See Settings Expander in SMC System Settings.
    c. DB service user: Desigo CC service user who requires HDB service user rights for maintenance operations. You can change it as required HDB Service Account Settings. See Settings Expander in SMC System Settings.
  • The Upgrade icon is enabled in the SMC toolbar.
  1. Click Upgrade .
  • A message displays.
  1. Click Yes.
  • The HDB is upgraded successfully is stopped by default and is linked to the named SQL Server instance under History Databases in the SMC tree and the HDB status is seen as Current.

 

4 – Start an HDB

You need to start the HDB once you upgrade it.

  • The History Database is stopped.
  1. In the SMC tree, select Database Infrastructure > [SQL Server Name] > [History Database name].
  1. Click Start Automatic Maintenance .
  • The History Database is started. Maintenance activities are performed on the database.

 

5 – Link an HDB to the Project
  1. In the SMC tree, select your project.
  1. Select the Project Settings tab and then the Server Project Information expander.
  1. In the Linked HDB drop-down list, select the restored History Database.
  1. Click Save .
  • The History Database is linked with the project and logs history data.

 

6 – Start the Project
  • At least one active project is available under Projects node in SMC tree.
  • The project is stopped and has unique port numbers.
  • (Only applicable for Projects on FEP)
    - You have copied and imported the same Windows key file, as that on the Server computer, on the disk of the FEP computer.
    - You have re-aligned the Client/FEP Project with the updated project on the Server.
  1. In the SMC tree, select Projects > [project].
  1. Click the Project Settings tab.
  • Project Settings displays.
  1. Click Start Project .
  • The Pmon service in the Windows services starts which in turn starts the project.