Version 4.7.1 upgrade error

Upgrade error

MetaDefender ICAP Server version 4.7.1 installers have an error that causes upgrades from previous versions failing.

Workaround

Prerequisites

The workaround requires the following:

  • Shell access to the MetaDefender ICAP Server

  • Read/write access to the following databases:

    Database

    Platform

    Default path

    Configuration

    Windows

    C:\Program Files\OPSWAT\Metadefender ICAP Server\data\config.db.sqlite

    Linux

    /var/lib/mdicapsrv/config.db.sqlite

    Inventory

    Windows

    C:\Program Files\OPSWAT\Metadefender ICAP Server\data\inventory.db.sqlite

    Linux

    /var/lib/mdicapsrv/inventory.db.sqlite

  • An SQLite client application (e.g. sqlite3 from https://www.sqlite.org/download.html) installed locally on the MetaDefender ICAP Server machine

Steps

To upgrade to ICAP Server version 4.7.1 from a previous version, perform the following steps:

  1. Upgrade the installation to ICAP Server version 4.7.0 (if your installation is not on this version yet)

  2. Take a backup

    Backup the configuration and inventory database files to be able to restore them in any case of error.

  3. Stop the MetaDefender ICAP Server (mdicapsrv) service:

    Platform

    Command

    Windows

    net stop mdicapsrv

    Linux

    service mdicapsrv stop

  4. Increase the version of the configuration database

    1. Connect to the database

      Windows example
      > sqlite3.exe C:\Program Files\OPSWAT\Metadefender ICAP Server\data\config.db.sqlite
      Linux example
      # sqlite3 /var/lib/mdicapsrv/config.db.sqlite
    2. Verify the current database version is appropriate

      SQLite code example
      sqlite> pragma user_version;

      If the database is on the correct version 4.7.0, then this value must be 54. If the version is something else, then restart at step 1.

    3. Increase the database version

      SQLite code example
      sqlite> pragma user_version = 55;
    4. Verify the database version is increased

      SQLite code example
      sqlite> pragma user_version;

      If the increase was successful then the value must be 55 now. If the version is something else, then go back to step 1.c.

    5. Exit SQLite

      sqlite> .exit
  5. Increase the version of the inventory database

    1. Connect to the database

      Windows example
      > sqlite3.exe C:\Program Files\OPSWAT\Metadefender ICAP Server\data\inventory.db.sqlite
      Linux example
      # sqlite3 /var/lib/mdicapsrv/inventory.db.sqlite
    2. Verify the current database version is appropriate

      SQLite code example
      sqlite> pragma user_version;

      If the database is on the correct version 4.7.0, then this value must be 3. If the version is something else, then restart at step 4.

    3. Increase the database version

      SQLite code example
      sqlite> pragma user_version = 4;
    4. Verify the database version is increased

      SQLite code example
      sqlite> pragma user_version;

      If the increase was successful then the value must be 4 now. If the version is something else, then go back to step 4.c.

    5. Exit SQLite

      sqlite> .exit
  6. Following the steps in 2.2.1 Installing MetaDefender ICAP Server using the command line, install MetaDefender ICAP Server version 4.7.1.

  7. The MetaDefender ICAP Server (mdicapsrv) service should be started automatically at the end of the installation. If it is not started by any reason, start it manually:

    Platform

    Command

    Windows

    net start mdicapsrv

    Linux

    service mdicapsrv start

  8. Your MetaDefender ICAP Server version 4.7.1 should be up now.