Version upgrade
When the ODABA schema version changes, which may happen with a new major version release, resource databases and databases referring to ODABA system data types (typically __OBJECT or DSC_Topc), have to be upgraded. The following paragraphs describe the upgrade procedure required for the latest version.
In order to upgrade a resource database (dictionary), the ode.sys database containing extended system resource definitions is required with old and new version. The installation contains an appropriate old version database (ode.sys_V21) preceded by the old version number. The new system database is the ode.sys shipped with the installation.
Before starting the upgrade procedure (Upgrade.cmd as described below), it is suggested to create a copy of the old database (here we use the extension _old). When copying the database terminates successfully, one may replace your dictionary with the upgraded resource database. From the example below, one may simply create your upgrade procedure by replacing %DB% and storing the Upgrade.cmd and Upgrade.ini file.
In order to upgrade an application database, which is rarely necessary, nearly the same procedure might be used. Just the DICTIONARY has to be replaced by old and new resource database, as shown in the comment lines in the ini-file. In this case, %DB% refers to the application database to be upgraded while %RDB% refers to the resource database, which already had been upgraded.
Under Linux a script is provided that evaluates the current database version and upgrades it to a temporary directory:
(/usr/local/share/odaba/upgrade /path/to/data.base)
// Upgrade.cmd, current directory is odaba
// DB stands for the database location
copy|cp %DB% %DB%_old
CopyResDB Upgrade.ini OLDDB NEWDB
PackDB %DB%_new -p:percent
// when completed successfully, replace DB
copy|cp %DB%_new %DB%
// Upgrade.ini (resource database) - required ini-file for copy
[SYSTEM]
DICTIONARY=ode.sys
DISABLE_CONTEXT=YES
[CopyResDB]
PLATFORM_INDEPENDENT=YES // required for non-windows databases
[OLDDB]
DICTIONARY=ode.sys_V21
DATABASE=%DB%_old
SYSTEM_VERSION=21
NET=NO
ACCESS_MODE=Write
DISABLE_CONTEXT=YES
[NEWDB]
DICTIONARY=ode.sys
DATABASE=%DB%_new
SYSTEM_VERSION=22
NET=NO
ACCESS_MODE=Write
DISABLE_CONTEXT=YES
PLATFORM_INDEPENDENT=YES