Upgrading the database schema

Features in Ipswitch WhatsUp Gold v11 mandate an update of the original database schema. The WhatsUp Gold installation program updates the database, provided the database is in the default configuration. A default configuration is one that meets the following conditions:

All other configurations are considered a non-default configuration. The WhatsUp Gold installation program will notify you if the database is in a non-default configuration.

You must first complete the WhatsUp Gold installation, then upgrade the database.

This section steps through how to upgrade an installation of WhatsUp Gold that is a non-default configuration.The procedures differ depending on whether the database server is on the same computer as WhatsUp Gold.

To upgrade the database from the WhatsUp Professional 2006 or earlier format to Ipswitch WhatsUp Gold v11 format, follow these steps:

  1. If your WhatsUp database is not on the same computer as Ipswitch WhatsUp Gold v11, copy the DB Scripts directory and all sub-directories to the remote server.

    Make note of the fully qualified path to the DB Scripts directory, as it will be required in the steps that follow.

  2. On the computer on which the database server is installed, from the command prompt window, go to the Upgrade Script sub-directory of the DB Scripts directory.

    Important: Before running the scripts, close the WhatsUp Gold application; then, shut down the WhatsUp engine (right-click the WhatsUp icon in the task tray, then select Close).

  3. Run the upgrade scripts, by running the Visual Basic (VB) script which runs each script in sequence, or by running each script individually.

    Warning: The upgrade scripts should be run one-time only. If an upgrade script is interrupted or errors occur, you must restore your database before running the scripts a second time.

    VB Script:

    In the command prompt window, execute the following VB script:

    cscript upgrade_db.vbs -E -S <sql server name> -d whatsup

    where the argument, sql server name, specifies the machine name\database instance name.

    Caution: osql arguments are case-sensitive (-d is not the same as -D)

    For example:

    cscript upgrade_db.vbs -E -S computer123\MySqlServerInstanceName
    -d whatsup

    The VB script executes the appropriate upgrade scripts, based on your existing WhatsUp Gold database schema file, by using information in the Transform.ini file.

To manually run the upgrade scripts:

The alternative to using the VB script is to manually execute the upgrade scripts on the SQL Server machine, as follows:

  1. The Upgrade scripts are found in a sub-directory within the DB Scripts directory named Upgrade Scripts. Using Notepad or a similar text editor, open each file whose name starts with "upgrade_from_" and use the Edit > Replace function to replace every occurrence of the <DATAFILESPATH> placeholder with the path to the DB Scripts directory.

    Note: Some of the upgrade scripts will have no placeholders; some will have more than one. No trailing slash should be used in the replacement string (For example, "upgrade_form_").

    Save each updated file.

  2. Run the scripts by using SQL Server Enterprise Manager (available on the SQL Server CD), or the osql command.

SQL Enterprise Manager:

Important: Open the SQL Server Enterprise Manager and select the server running the WhatsUp Gold database. From the Enterprise Manager, open the SQL Server Query Analyzer, and select the WhatsUp Gold database in the drop-down selector found in the toolbar.

Determine your current WhatsUp Pro database schema version by executing the following statement in the SQL Server Query Analyzer:

SELECT sValue FROM DatabaseProperty WHERE sName = 'Version'

The value returned should be a six digit number. Next, in Notepad, open the Transform.ini file (it is located in the Transforms folder) and locate, in the [VERSIONS] section, the "Version" entry that corresponds to that six-digit number. (For example, 102203 corresponds to Version 10). Make a note of that number, which we'll refer to as the 'starting transform number'.

Next, look in the [SCRIPTS] sections, and make a note of all the "Transform" entries beginning with the one after your 'starting transform number'. In our 102203 example, that would be 10 + 1, or 11. These are the upgrade scripts that you need to run manually: in our example, that would be all the scripts starting with "Transform11" and ending with the highest number script.




Transformnn=upgrade_from_nnnnnn_to_nnnnnn.sql (last script)

Using the SQL Server Query Analyzer, select File > Open and load each script, then press F5 to execute, in order.

Caution: Manually executing the incorrect scripts, or executing the correct scripts out of order, will cause database schema errors. Be sure you have a backup before attempting this manual execution.

Osql command:

Run the scripts in the order shown above using the osql command as follows:

osql -E -S <sql server name> -d whatsup
-1 <script name.sql> {-o errorlog.txt}

For example:

osql -E -S computer123\MySqlServerInstanceName -d whatsup
-1 upgrade_from_101206_to_102.sql -o errorlog.txt

Following successful execution of the scripts, your WhatsUp Gold database will be up-to-date and ready for use by Ipswitch WhatsUp Gold v11. All data previously collected should be present within the updated database.

  1. To confirm that the database upgraded successfully, check the "Current Version" as you did in step 2, and confirm that it matches the version number in the last transform script.
  2. Select Control Panel > Administrative Tools > Services and verify that the status of Ipswitch WhatsUp Engine service is Started. If it is not, start the service.
  3. You can now launch NMConsole.exe or start the application via the program shortcuts.