Ant tasks for database migration

Your installation provides Ant tasks to copy the contents of an old database into the new schema, and to grant the required privileges to the database user referenced in the data source.

The following table describes the Ant tasks for migrating the database.

Table 1. Ant tasks for migration
Ant Task Version Purpose
gen-migration-role Since V8.6 Creates an SQL script that grants required privileges to the database user referenced in the data source. The role has select permission on all required tables of the old database. You can execute this role task against any database, not just those requiring specific privileges. However, you do not have to use the generated script with all databases.

gen-migrationXX-role

V7.5 to V8.5 Creates an SQL script that grants required privileges to the database user referenced in the data source. The role has select permission on all required tables of the old database. You can execute this role task against any database, not just those requiring specific privileges. However, you do not have to use the generated script with all databases.
gen-migration-script Since V8.6 Creates the SQL script used to copy the old database content into the new schema.

gen-migrationXX-script

V7.5 to V8.5 Creates the SQL script used to copy the old database content into the new schema.
gen-prog-migration-script Since V8.6 To migrate part of your database until you are ready to migrate the rest.

gen-prog-migrationXX-script

V7.5 to V8.5 To migrate part of your database until you are ready to migrate the rest.

To migrate from Operational Decision Manager V8.6 or later to the current version, use gen-migration-script.

If you migrate from a version between V7.5 and V8.5, use Ant tasks that contain XX in the script name, which represents the version from which you are migrating:

  • gen-migration75-script to migrate from WebSphere® Operational Decision Manager V7.5 to the current version.

  • gen-migration80-script to migrate from Operational Decision Manager V8.0 or V8.0.1 to the current version.

  • gen-migration85-script to migrate from Operational Decision Manager V8.5 to the current version.

Note: Migration is optional, but provides the latest features of the current version.

In addition, if you do not migrate from version 8.6 and want to use the metrics with your simulations in the Business console, then you need to run an SQL script to add the domain metric for simulation.

You do not need to migrate the database incrementally. Each version provides one Ant task, which migrates your version to the current version. For example, the Ant task gen-migration75-script migrates a database from V7.5 to V8.10.5.

The Ant tasks for migration take the following parameters:

-Dserver.url=<new server url>

-DdatasourceName=<JNDI name of the new data source>

-DoldDatabaseSchemaName=<database schema name used in previous data source>
Note:

MySQL does not support database schemas. However, you can achieve the same behavior by using a different database for the new release. Therefore, with MySQL, you must call Ant tasks by using the old database name instead of the old schema name.

The Ant tasks produce SQL scripts that you can execute by using the execute-schema Ant task.

To migrate your database:
  1. Verify which datasource schema version you need to use.

    To verify which Ant task to use, go to the About page in the Enterprise console to confirm the datasource schema version.

  2. Ensure you are an administrator.
  3. Use the gen-migration-role Ant task (or gen-migrationXX-role for versions 7.5 to 8.5).
    Note: Because gen-migration-role is compatible with all schemas starting with V8.6, when you run it, it generates a script with the list of all tables available in old releases. This list might include some tables that are not available in the migrated schema. Because of those missing tables, you might see some errors when executing the script generated by gen-migration-role, but they have no consequence on your migration.
  4. Execute the generated script to grant to required privileges to the database user referenced in the data source.
  5. Use the gen-migration-script Ant task, even if you are migrating only part of the database (or gen-migrationXX-script for versions 7.5 to 8.5).
    Tip:

    For databases using sequences (for instance Oracle or DB2®), the migration script should be executed immediately after it is generated so that the original repository is not updated after the script is generated. This is because if the sequence values to use are specified in the migration script, then they should not get updated. This restriction does not apply to databases for which sequences are not used.

  6. Execute the generated script to copy the old database content into the new schema.
If you want to migrate only part of the database, you will also need to use the gen-prog-migration-script Ant task. See Migrating the database progressively for more information.

Running the migration script may require some time, and it may hit the application server timeouts if it is executed using the execute-schema Ant task. In this case, you may consider running it using your favorite database tool (for instance sqlplus for Oracle) instead of using the execute-schema Ant task.

Demonstration video

In the following video, an Ant task is used in migrating a Decision Center database on an Oracle database server:

Video shows a demo on migrating Operational Decision Manager.