This article describes how to migrate the WGS, Manage, and Core Permits databases from meshIQ 11.x to meshIQ 12.1.1 using the jdbcmk utility.
Back up the existing databases and permits data before starting the migration. Do not modify the source databases directly. The migration creates new target databases from the existing source databases.
Overview
The migration uses the following source and target databases:
| Component | Source Database | Target Database |
| WGS | nastel_apwmq | meshiq_wgs |
| Manage | nastel_permv3 | meshiq_manage |
| Core Permits | nastel_permv3 | meshiq_core_perm |
Migrate the WGS Database
The legacy WGS database is nastel_apwmq. Create the new meshiq_wgs database from the legacy database and then upgrade the WGS database objects.
Clone the legacy database (
nastel_apwmq)- If
meshiq_wgsalready exists, delete it using the following command:
dropdb -h localhost -U postgres meshiq_wgs
- Create a new database called
meshiq_wgsby copying the existingnastel_apwmqdatabase using the following command:
createdb -h localhost -U postgres \ -T nastel_apwmq \ meshiq_wgs- If
Rename the WGS Schema.
The cloned database initially contains the
nastel_apwmqschema. Rename it tomeshiq_wgs:psql -h localhost -U postgres -d meshiq_wgs \ -c "ALTER SCHEMA nastel_apwmq RENAME TO meshiq_wgs;"Upgrade WGS Database Objects.
Ensure that the
manage.propertiesfile in[PLATFORM_HOME]/sql-scripts/managecontains the correct database details before runningjdbcmk.sh.Run the
jdbcmkutility:From shell run:
./jdbcmk.shFrom the
jdbcmkmain menu, select Option 2.Then select Option 2 from WGS/MANAGE DATABASE menu, to upgrade the WGS Database Objects.
Migrate the Manage Database
The legacy Manage database is nastel_permv3. Create the new meshiq_manage database and upgrade the Manage database objects.
Clone the legacy database(
nastel_permv3).- If
meshiq_managealready exists, delete it using the following command:
dropdb -h localhost -U postgres meshiq_manage
- Create the new database called
meshiq_manageby copying from the old databasenastel_permv3using the following command:
createdb -h localhost -U postgres \ -T nastel_permv3 \ meshiq_manage- If
Rename the Manage Schema.
The cloned database initially contains the
nastel_permv3schema. Rename it tomeshiq_manage:psql -h localhost -U postgres -d meshiq_manage \ -c "ALTER SCHEMA nastel_permv3 RENAME TO meshiq_manage;"Upgrade Manage Database Objects.
Ensure that the
manage.propertiesfile in[PLATFORM_HOME]/sql-scripts/managecontains the correct database details before runningjdbcmk.sh.Run the
jdbcmkutility:From your shell run:
./jdbcmk.shFrom the
jdbcmkmain menu, select Option 2.
Then select Option 4 from WGS/MANAGE DATABASE menu, to upgrade the Manage Database Objects.
Remove Obsolete WGS Permits Objects.
After upgrading the Manage database, remove the obsolete WGS permits objects.
From your shell run:
./jdbcmk.shFrom the
jdbcmkmain menu, select Option 2.
Then select Option 7 from WGS/MANAGE DATABASE menu, to remove the obsolete WGS permits objects from the Manage database.
Migrate the Core Permits Database
The Core Permits database is created from the legacy nastel_permv3 database.
The migration converts the legacy PERMITSV3 objects to the new CORE_PERMITS objects and then upgrades them for meshIQ 12.1.1.
Clone the legacy database (
nastel_permv3).- If
meshiq_core_permalready exists, delete it using the following command:
dropdb -h localhost -U postgres meshiq_core_perm
- Create a new database named
meshiq_core_permby copying from the old databasenastel_permv3using the following command:
createdb -h localhost -U postgres \ -T nastel_permv3 \ meshiq_core_perm- If
Rename the Core Permits Schema.
The cloned database initially contains the
nastel_permv3schema. Rename it tomeshiq_core_perm:psql -h localhost -U postgres -d meshiq_core_perm \ -c "ALTER SCHEMA nastel_permv3 RENAME TO meshiq_core_perm;"Migrate legacy
PERMITSV3objects toCORE_PERMITSEnsure that the
core.propertiesfile in[PLATFORM_HOME]/sql-scripts/corecontains the correct database details before runningjdbcmk.sh.Run the
jdbcmkutility:From your shell run:
./jdbcmk.shFrom the
jdbcmkmain menu, select Option 1.Then select Option 3 from CORE DATABASE menu, to migrate the Core Permits from WGS PERMITS Database objects.
Upgrade
CORE_PERMITSDatabase Objects.After migrating the legacy
PERMITSV3objects toCORE_PERMITS, upgrade the Core Permits database objects.Run the
jdbcmkutilityFrom your shell run:
./jdbcmk.shFrom the
jdbcmkmain menu, select Option 1.Then select Option 2 from CORE DATABASE menu, to upgrade the Core Permits Database objects.
Remove Obsolete Manage Objects.
After upgrading the Manage database, remove the obsolete WGS permits objects.
From your shell run:
./jdbcmk.shFrom the
jdbcmkmain menu, select Option 2.
Then select Option 4 from CORE DATABASE menu menu, to remove the obsolete Manage objects from the Core Permits database.
Click here to view an overview of the database migration process
Result
After completing the migration, the target databases should be available as follows:
| Component | Target Database | Schema |
| WGS | meshiq_wgs | meshiq_wgs |
| Manage | meshiq_manage | meshiq_manage |
| Core Permits | meshiq_core_perm | meshiq_core_perm |