Update the database

 

To find out the version of your database,

  1. from the Watchdoc administration web interface, go to Main menu, Configuration section, > Advanced configuration > Statistics database.

  2. In the Statistics section, the version of the database is displayed in the Primary database box:


If the database needs to be updated:

  1. Go to the folder where the installation package files were extracted.

  2. Unzip the kernelXX folder.

  3. In the kernelXX folder, open the SQL folder.

  4. Depending on your database type (MSSQL, PostgreSQL, or SQLite), locate the update file(s) [database_type]_update-XX.

  5. Perform the update in stages: from the Kernel[version number].zip\SQL folder, run all the [database type]_update_[version] updates between the version installed in your environment and the new version.

    For example:

    • if you are starting from v. 5.4 or v. 5.5, you perform 1 update (to v. 6.0);

    • if you are starting from v. 5.2 or v. 5.3, you perform 2 updates (to v. 5.4, then to v. 6.0);

 

A SQL Server database can be updated with two tools :

  1. with the MS SQL Server Management Studio® tool:

  2. with the command line tool sqlcmd integrated with the database.

    Commands examples to execute a script file :
    sqlcmd -S localhost\watchdoc -U sa -d watchdocstats -i mssql_update_XX.sql -o QueryResults.txt -e

    • -S : server name

    • -U : login

    • -d : database name

    • -i : script to execute

    • -o : output file

    • -e : add script file commands in the output file

  1. Once the database has been updated, restart the Watchdoc service so that it can take the database change into account.