Upgrading the network model
The upgrading procedure repeatedly involves starting and stopping Optima services. For information on checking, starting, and stopping Optima services: → Managing Optima services.
Some steps of the procedure may slightly vary depending on your installation scenario. Make sure you follow the instructions that match your scenario (→ Installation scenarios).
Requirements for being able to upgrade the network model
-
You need access to:
- The sever hosting the .NET components
- The server hosting the Optima database
- The server hosting the Optima application server
-
You need the following components:
- Visum software
- Calibrated current model and simulation model
- Turn probabilities as a result of the offline calibration (file tprb.sql provided by the modelers team)
- SaveAll.vbs script
- TDE component
Important: During the update, Optima must be stopped and restarted. It is good practice to notify in advance all persons who might be affected by the upgrade process.

- On a machine that has Visum installed, copy the current model and the simulation model to an empty folder.
- Copy the script saveAll.vbs to the same folder.
- Rename the current model to: CurrentModel.ver
- Open the current model in Visum.
-
Drag the script saveAll.vbs to Visum.
The script exports the model into a set of text-based files located in the same folder as the file CurrentModel.ver. Ignore the warnings about missing attributes.
The resulting files are:
- CurrentModel.dmd
- CurrentModel.xml
- CurrentModel.net
- Close Visum without saving.
- Rename the simulation model to SimulationModel.ver.
- Open the simulation model in Visum.
-
Drag the script saveAll.vbs to Visum.
The script exports the model into a set of text-based files located in the same folder as the file SimulationModel.ver. Ignore the warnings about missing attributes.
The resulting files are:
- SimulationModel.dmd
- SimulationModel.xml
- SimulationModel.net

Step 1: Creating an empty database
- On the .NET server, copy the files generated previously plus the file tprb.sql to the folder /model_update/ within the TDE installation folder.
- Connect to the database server by selecting it from the list on the left panel.
- Open the folder: $TDE/database_definition
- Right-click the script: create-empty-db.bat
-
On the shortcut menu, click Edit.
Caution: Do not run the script now!
- Change NEW_DB_NAME to a name that does not yet exist in the database list.
- Make sure that the connection parameters point to the server that hosts the Optima database.
- Double-click the script to execute it.
- Open pgAdmin 4.
- Verify that the new database has been created.
Step 2: Importing the model
- Open pgAdmin 4.
- Truncate all model tables by using: \TDE\scripts\DB_TRUNCATOR.sql
- In the installation path of TDE, open the folder: \TDE\exec\
-
Verify the configuration file CommandLineTDE.csv (→ Methodology and Configuration).
The following table gives you some hints to configure TDE:
Key Description Notes DS_OPUT Connection string to the Optima real-time database The parameter Database must match the name of the database created DS_MAIN Path to the current model Do not add any file extension DS_NETW DS_TATTDS_LKST
Path to the simulation model Do not add any file extension DS_DEMD
DS_DEMS−2 to disable the .dmd files −2 to disable the .dmd files
Use −1 if you use the .dmd files DS_FUNC −2 to disable the .xml files Use −1 if you use the .xml files - Execute TDE_GUI.exe. (To do so, select Execute in the review window.)
Step 3: Importing the TPRB table (and if provided the RLIN_TSYS_TRE_EQUA table)
- Copy the file
\TDE\model_update\tprb.sql
into the folder
\TDE\database_definition\custom_scripts\ - Open the folder: C:\optima\optima_zip\PTV-Optima-XXXXX\optima-db\custom_scripts
-
Right-click the file: load-custom-script.bat
-
On the shortcut menu, click Edit.
Caution: Do not run the script now!
- Change NEW_DB_NAME to a name that does not yet exist in the database list.
- Make sure that the connection parameters point to the server that hosts the Optima database.
- Execute the script: load-custom-script.bat
Step 4: Verifying the validity of the database
On the .NET server:
-
Open the TDE log file:
C:\optima\TDE\LogFile_TDE_GUI.log
Important: It is MANDATORY to check for the absence of ERROR messages in the log file.
- Open pgAdmin 4.
-
Click Ctrl+E to open the Query Manager.
-
Execute the following queries to verify basic database integrity (click F5 to execute a query):
- SELECT COUNT(*) from link must return the number of assignment links of the model (greater than zero).
- SELECT COUNT(*) from strt must match the number of links in the Navteq network (greater than zero).
- SELECT COUNT(*) from lkst must be greater than zero.
If all the checks listed have been successful, you get a valid DB.

This step involves starting and stopping services. For information on how to stop and start Optima services: → Managing Optima services.
-
On the server that hosts the .NET components:
- Stop the service: PTV Optima AS.
- Stop the service PTV Optima TRE.
- Stop the service Hyperpath.
- Stop the service PTV TrafficDataWarehouse.
-
Rename the old database:
- Open pgAdmin 4.
- Right-click the database optima.
- Click Properties.
- Change the name to optima_backup.
- Click Save.
-
Rename the new database:
- In pgAdmin 4, right-click the database you previously created.
- Click Properties.
- Change the name to optima.
- Click Save.
- Start the service PTV Optima AS.
- Start the service PTV Optima TRE.
- Start the service Hyperpath.
- Start the service PTV TrafficDataWarehouse.