Replugging Orphaned Paths

Once you have run the migration on your database, you can run the Unified Typing Tool with the -replug option to replug the eligible orphaned paths, if any.

An orphan path is a path that points to an object that was missing from the database when you ran the Unified Typing Tool.

An orphaned path is eligible for replugging when it meets both of the following conditions:

  • The missing object is any of the following types:
    • NotMigratedReference.
    • NotMigratedRepReference.
    • NotMigratedInstance.
    • NotMigratedRepInstance.
    • NotMigratedConnection.
    • NotMigratedPort.
    Important: Any other types than those listed above are not supported.
  • The missing object is now present in the database.

This task shows you how to:


Before you begin: Run the migration. For more information, see Running the Migration.

Run the Unified Typing Tool with the -replug Option

In MQL, run the following command:

exec prog emxNewTypingMigrationProgram -replug [nThreads] [-tSize nPerBlockSize] –dir <WorkingFolder> [-commit]

Where:

  • nThreads: Specifies the number of threads to use. If not specified, it is by default 1.
  • nPerBlockSize: Specifies the number of MQL requests to handle by thread and by loop. If not specified, it is by default 1000.
  • WorkingFolder: Specifies the working folder, that is, where to put logs, requests, etc. This clause is mandatory.
  • commit: Commits the command. If not specified, the command is simulated but not committed.

For example:

  • Example 1:

    exec prog emxNewTypingMigrationProgram –dir /tmp/NewTypingMigration -replug

    The working directory is /tmp/NewTypingMigration. The command is executed on a single thread, and the number of orphaned paths to process per loop is 1000 (default number).

    This means that if the database contains 10,000 orphaned paths, the thread loops 10 times.

  • Example 2:

    exec prog emxNewTypingMigrationProgram –dir /tmp/NewTypingMigration –replug 2 –tSize 2000

    The working directory is /tmp/NewTypingMigration. The command is executed on two threads, and the number of orphaned paths to process per loop is 2000.

    This means that if the database contains 10,000 orphaned paths, one of the threads executes 3 loops, replugging 2000 orphaned paths per loop, and the second thread executes 2 loops, replugging 2000 orphaned paths per loop.

    If the database contains 1500 orphaned paths, one of the threads executes 1 loop, replugging the 1500 orphaned paths with the loop, and the second thread does nothing.

The Unified Typing Tool scans the entire database to find all orphaned paths. For each orphaned path, it checks whether the object that was missing when you ran the Unified Typing Migration Tool is now present in the database.

If the missing object is now present, the Unified Typing Migration Tool replaces the NotMigratedXXXX part of the path with the genuine type when migrating to the Unified Typing architecture.

Important:
  • The -replug option can only replace the NotMigratedXXXX part for missing elements that have a type that is both set by the Unified Typing Migration Tool and that is any of the following:
    • NotMigratedReference.
    • NotMigratedRepReference.
    • NotMigratedInstance.
    • NotMigratedRepInstance.
    • NotMigratedConnection.
    • NotMigratedPort.
  • Data races are taken into account: Two threads cannot process the same orphaned path.

The tool generates the following files:

  • ReplugSRResult.txt: Contains on each line the path element that contains a missing object.
  • ReplugSRResult_KO.txt: Contains the orphaned paths that result in an error when replugging.
  • ObjectsWithForbiddenTypeOnReplug.txt: Contains the missing objects that have a forbidden type (that is, any type other than NotMigratedReference, NotMigratedRepReference, NotMigratedInstance, NotMigratedRepInstance, NotMigratedConnection, and NotMigratedPort).

Troubleshoot the Out Of Memory Error

Context: The Unified Typing Tool executed with the -replug option issues an Out Of Memory error when the ReplugSRResult.txt file that it generates is too large. In this case, do the following:

  1. Set the NTMigNotOverwriteFileIfExist environment variable to Yes:

    • Windows: set NTMigNotOverwriteFileIfExist=Yes
    • Linux: export NTMigNotOverwriteFileIfExist=Yes

  2. Split the ReplugSRResult.txt file into smaller files.

    For example, you can split it into several files of 100,000 lines per file.

    Note: The ReplugSRResult.txt file is located in the <WorkingFolder> that you specified with the -dir clause when you ran the tool.

  3. Write a Tcl or Shell to loop through each split file while doing the following:
    1. Copy the split file content to ReplugSRResult.txt.

      Note: Each loop overwrites the existing content of ReplugSRResult.txt.

    2. Run the following MQL command:

      exec prog emxNewTypingMigrationProgram -dir <WorkingFolder> –replug –commit

      This command makes changes in the database and replugs the orphaned paths of the data.

    You can contact your service team for assistance in writing this Tcl or Shell.