Update the Repository

When you have migrated your configuration to the new IDM installation, you need to handle the data that is stored in your repository. There are two options to update a repository:

When you have upgraded the repository, or created a new repository, start the IDM server and test that all your scripts are working as expected, before migrating your data.

Upgrade an Existing Repository

Upgrading an existing repository means that you do not need to migrate data. However, you must run a series of scripts that modify the repository, to use the new features in IDM 7.1.

Important

Because the repository upgrade scripts are incremental, you must review each major version upgrade after your current release. For example, when upgrading from 6.5.x to 7.1.x, review the upgrade process and scripts for 7.0.x and 7.1.x (this version).

Repository upgrade procedures:

Prepare an existing repository for IDM 7.1 as follows:

  1. Shut down IDM, if it is running.

  2. Clear all configobjects related tables. For example, in MySQL run:

    DELETE FROM openidm.configobjects;
    DELETE FROM openidm.configobjectproperties;
  3. From your IDM 7.1 installation, run the schema update script for your database type.

    Note

    You do not need to run this script if you are using a PostgreSQL repository.

    The only schema update script for this release is /path/to/openidm/db/database-type/scripts/updates/00-propertyindex.sql. This script adds support for searchable array fields.

    1. Before you run 00-propertyindex.sql, modify the script for any properties table that is associated with a generically mapped object. Add and remove property tables, as necessary.

      For each property table in the script, a new column, propindex, is added and the primary key is dropped and modified to include the propindex column.

    2. When you have modified the script, run it.

    3. Optional: If you want to use a query filter on any searchable array field, run the rewriteObjects.js script for that object path.

      Important

      You can only run the rewriteObjects.js script when the upgrade is complete, and IDM 7.1 is running, but not yet in use by any public clients.

      To run the update/rewriteObjects.js script, specify the objectPaths of the arrays to make searchable. For example:

      curl \
      --header "Content-Type: application/json" \
      --header "X-OpenIDM-Username: openidm-admin" \
      --header "X-OpenIDM-Password: openidm-admin" \
      --header 'X-OpenIDM-NoSession: true' \
      --request POST \
      --data-raw '{
        "type": "text/javascript",
        "file": "/path/to/openidm/bin/defaults/script/update/rewriteObjects.js",
        "globals": {
          "rewriteConfig": {
            "queryFilter": "true",
            "pageSize": 1000,
            "objectPaths": [
              "repo/config",
              "repo/internal/usermeta",
              "repo/managed/role",
              "repo/managed/user",
              "repo/reconprogressstate",
              "repo/relationships",
              "repo/scheduler/triggers"
            ]
          }
        }
      }' \
      "http://localhost:8080/openidm/script/?_action=eval"
  4. Launch IDM and run the following Groovy script to clear the reconprogressstate data in your repository:

    def result = openidm.query(
      "repo/reconprogressstate", [ "_queryFilter" : "true", "_fields" : "_id" ]).result;
    for ( item in result ) {
      openidm.delete("repo/reconprogressstate/" + item["_id"], null);
    }
    return result.size() + " reconprogressstate records deleted";

    This script will work regardless of the type of repository, and can be sent as a REST call. For example:

    curl \
    --header "X-OpenIDM-Username: openidm-admin" \
    --header "X-OpenIDM-Password: openidm-admin" \
    --header "Content-Type: application/json" \
    --request POST \
    --data '{
      "type":"groovy",
      "source":"def result = openidm.query(\"repo/reconprogressstate\", [ \"_queryFilter\" : \"true\", \"_fields\" : \"_id\" ]).result; for ( item in result ) { openidm.delete(\"repo/reconprogressstate/\" + item[\"_id\"], null); }; return result.size() + \" reconprogressstate records deleted\";"
    }' \
    "http://localhost:8080/openidm/script?_action=eval"
    "1 reconprogressstate records deleted"
  5. Verify that all scripts and functions behave as expected.

Create a New Repository

Set up a new repository, following the steps in Select a Repository. A new repository is already configured for all the new capabilities in IDM, but does require migrating existing data to that repository.

If you create a new repository, you must still update your configuration files to use the new features.

After you have set up the new repository, migrate your data to that repository.

Read a different version of :