Upgrading to Version 5.0 - AppGeo/GPV GitHub Wiki

There have been two major changes at GPV version 5.0 which somewhat complicate the upgrade from a version 4.2 configuration:

  1. Most GPV instance settings have been moved from the Web.config file to the GPVSetting table. As part of this move the projection settings have been replaced with a single Proj4 string.
  2. For SQL Server, keys are now case sensitive and will no longer match in primary/foreign key relationships if the text strings don't match exactly. Keys have always been case sensitive in Oracle.

A few new utilities have been provided to make this upgrade as easy as possible. Please take the follow steps to upgrade. These assume you are using SQL Server.

1. Install the GPV 5.0 web application

Create a directory, copy in the application code, and set up the directory as a virtual directory in IIS as usual.

2. Create the version 5.0 configuration tables

Edit the GPV50_SQLServer_Upgrade.sql script with your version 4.2 and new version 5.0 table name prefixes then run the script in your database to generate the upgraded tables. The GPVSetting table will be populated with default values. The two required settings, AdminEmail and FullExtent, will be empty so at this point GPV 5.0 will be unable to run. Do not run GPV50_SQLServer_AddConstraints.sql at this time.

3. Copy in previous Web.config settings

The GPV 5.0 web application code contains a page named UpdateSettings.ashx which will download your previous Web.config settings as a SQL script. You can run this in either of two ways:

  1. (Recommended) Copy UpdateSettings.ashx to your version 4.2 web application then navigate to that page in a web browser to download the SQL script. You can then delete UpdateSettings.ashx from version 4.2.
  2. Copy your 4.2 Web.config settings into the 5.0 Web.config file, and then run UpdateSettings.ashx from there to download the SQL script. You can then delete the settings from the 5.0 Web.config file.

The output script, which will be named UpdateSettings.sql, will contain a set of SQL UPDATE statements that copy your settings into the new GPVSetting table. Edit this script and make sure that the name of the GPVSetting table has the appropriate prefix then run the script in your database. Your projection settings will be converted automatically to an equivalent Proj4 string.

4. Check for mismatching keys

In your database run GPV50_SQLServer_Check_IDs.sql to see if you have any mismatching cases in your keys. The first few rows of output will look similar to this:

From Table Column To Table Mismatches
GPV50Application ZoneLevelID GPV50ZoneLevel 0
GPV50ApplicationMapTab ApplicationID GPV50Application 2
GPV50ApplicationMapTab MapTabID GPV50MapTab 0

If the number of mismatches is not zero, investigate the mismatching keys with SELECT statements and correct the cases as necessary. An example for the mismatches above:

SELECT ApplicationID from GPV50Application where ApplicationID not in 
    (SELECT ApplicationID from GPV50ApplicationMapTab)
ApplicationID
ForestryApp
SELECT ApplicationID, MapTabID from GPV50ApplicationMapTab where ApplicationID not in 
    (SELECT ApplicationID from GPV50Application)
ApplicationID MapTabID
forestryapp StandsMap
forestryapp RoadsMap

In this example the ApplicationID of forestryapp in GPV50ApplicationMapTab must be changed to ForestryApp to match the primary key in GPV50Application.

5. Add key constraints

Once all key mismatches have been corrected and running GPV50_SQLServer_Check_IDs.sql shows no mismatches you can run GPV50_SQLServer_Add_Constraints.sql to add the required primary/foreign key constraints to the tables.

6. Complete the installation

You can now set the database connection and table prefix in the Web.config file and test the GPV 5.0 installation by running the app.

At this point you have replicated the configuration of your version 4.2 instance in version 5.0. If you would like to use the new tiled image layers feature follow the steps in Transition to Tiles in Version 5.0.