Using the UpgradeDB.exe tool to upgrade the Sophos database

  • Article ID: 65420
  • Rating:
  • 15 customers rated this article 3.9 out of 6
  • Updated: 10 Aug 2013

In some cases the Sophos database is not fully upgraded by the management server installer. There are various reasons for the Sophos database not having been upgraded, the most common are:

  • An error in the upgrade process
  • You have chosen to populate the database after the upgrade
  • You previously uninstalled a version of the management server and reinstalled (i.e., the previous database is still in the SQL Server instance).

In any case you may have to run the UpgradeDB.exe command to migrate the data from the previous Sophos database to the latest version. This article explains how to use the UpgradeDB.exe program to upgrade (i.e., transfer data from) a previous Sophos database to the current.  This is the same tool called during the upgrade of the management server component.

Known to apply to the following Sophos product(s) and version(s)

Sophos Enterprise Manager 4.7.0
Sophos Enterprise Manager
Enterprise Console 5.2.1
Enterprise Console 5.2.0
Enterprise Console 5.1.0
Enterprise Console 5.0.0
Enterprise Console 4.7.1
Enterprise Console 4.7.0

What to do

  1. On the Sophos management server (Where the management service is installed, database can be remote), open a command prompt (Start | Run | Type: cmd.exe | Press return), and then change to the following directory:
    • Enterprise Console v4.x/ 5.x - \Program Files (x86)\Sophos\Enterprise Console\
    • Enterprise Manager v4.x - \Program Files (x86)\Sophos\Enterprise Manager\
    • Small Business v4.x - \Program Files (x86)\Sophos\SCC\

    Note: The utility queries the following registry string to locate which computer and SQL Server instance name the database is installed in, be it local or remote:HKEY_LOCAL_MACHINE\SOFTWARE\(Wow6432Node)\Sophos\EE\Management Tools\DatabaseConnectionMS.

  2. Enter the command upgradedb.exe and the required command line parameters:

    Note: Correct capitalization of sourceVersion in the commands below is important.

    -sourceVersion=52
    specifies the SOPHOS52 database to upgrade from. 

    -sourceVersion=51
    specifies the SOPHOS51 database to upgrade from.  

    -sourceVersion=50
    specifies the SOPHOS50 database to upgrade from.

    -sourceVersion=47
    specifies the SOPHOS47 database to upgrade from.

    -sourceVersion=45
    specifies the SOPHOS45 database to upgrade from.

    -sourceVersion=2
    specifies the SOPHOS2 database to upgrade from. This option is required for Small Business v4.x upgrades. 

    -reset
    if the Sophos Management service has been started (even briefly) and therefore the upgrade has proceeded pass the initial stage you can reset the 'new' database with this parameter.  

    -debug
    prints to screen useful information that is necessary to troubleshoot an upgrade problem.  It is always best to use this option. NOTE: -trace prints the same information

    -udl=filePath\fileName.udl
    if the DatabaseConnectionMS string in the registry is incorrect or needs to be temporarily overridden you can bypass the current registry string by creating a UDL test file and specify the file in command.

Note: For a list of supported upgrade paths see article 119105.

Example usage

Command Description
upgradedb.exe -debug -sourceVersion=52 Show useful information on screen and attempt to copy data from a SOPHOS52 database to SOPHOS521
upgradedb.exe -debug -sourceVersion=51 Show useful information on screen and attempt to copy data from a SOPHOS51 database to SOPHOS52
upgradedb.exe -debug -sourceVersion=50 Show useful information on screen and attempt to copy data from a SOPHOS50 database to SOPHOS51
upgradedb.exe -debug -sourceVersion=47 Show useful information on screen and attempt to copy data from a SOPHOS47 database to SOPHOS50
upgradedb.exe -debug -sourceVersion=45 Show useful information on screen and attempt to copy data from a SOPHOS45 database to SOPHOS47
upgradedb.exe -debug -sourceVersion=2 Show useful information on screen and attempt to copy data from a SOPHOS2 database to SOPHOS4. This is only valid for Sophos Control Center.
upgradedb.exe -debug -sourceVersion=45 -udl=sophos.udl Show useful information on screen, attempt to copy data from a SOPHOS45 database to a SOPHOS47 and bypass the registry connection string and instead use the string from the sophos.udl file (which in the example above would have to be in the same folder as the upgradedb.exe file since no path was specified).

Technical Information

'UpgradeDB.exe' is run as part of the management server installer and not as part of the database installer.  It reads the database connection string from the registry of the management server, namely HKEY_LOCAL_MACHINE\SOFTWARE\[Wow6432Node]\Sophos\EE\Management Tools\DatabaseConnectionMS', to locate the SQL instance where the Sophos database resides.  

'UpgradeDB.exe' calls the SQL stored procedure 'dbo.FromXto4' or 'dbo.FromX' (depending on version) in the new database to initiate the transfer. Examples of the called commands are as follows:

Upgrade Scenario Database Command
Enterprise Console 4.0 to Enterprise Console 5.0   SOPHOS50 dbo.FromXto4 4, 0
Enterprise Console 4.5 to Enterprise Console 5.0   SOPHOS50 dbo.FromXto4 45, 0
Enterprise Console 4.5 to Enterprise Console 5.1  SOPHOS51 dbo.FromXto4 45, 0
Enterprise Console 4.7 to Enterprise Console 5.0   SOPHOS50 dbo.FromXto4 47, 0
Enterprise Console 5.0 To Enterprise Console 5.1  SOPHOS51 dbo.FromXto4 50, 0
Enterprise Console 5.0 To Enterprise Console 5.2  SOPHOS52 dbo.FromX 50, 0
Enterprise Console 5.1 To Enterprise Console 5.2  SOPHOS52 dbo.FromX 51, 0
Enterprise Console 5.0 To Enterprise Console 5.2.1 SOPHOS521 dbo.FromX 50, 0
Enterprise Console 5.1 To Enterprise Console 5.2.1 SOPHOS521 dbo.FromX 51, 0 
Enterprise Console 5.2 To Enterprise Console 5.2.1 SOPHOS521
SophosSecurity
dbo.FromX 52, 0
dbo.RedirectSynonyms 'SOPHOS521'

If this data is moved successfully from the old database to the new database the 'UpgradeStatus' value in the 'dbo.Upgrade' table of the new database is then set to 2.  

The upgrade status value is used to tell the Sophos Management Service that the new database has been upgraded as is ready to be used.  If the value is not 2 it will fail to start until the upgrade status is correct.

 
If you need more information or guidance, then please contact technical support.

Rate this article

Very poor Excellent

Comments