Db2 Net Search Extender index migration tool from 32-bit to 64-bit (Windows)

Db2 Net Search Extender indexes built under 32-bit Db2 instances are not compatible with 64-bit instances. Trying to search or to update an index that was built under a 32-bit Db2 instance in a 64-bit instance results in an error message being returned.

The index migration tool migrates indexes offline and avoids rebuilding indexes. The migration affects only a small number of metadata files and is performed quickly without a large amount of data movement. To perform this migration execute the batch script which is delivered within this package.

Migrate index from V8 32-bit to V9 64-bit

This migration tool runs only on a 32-bit source Net Search Extender instance which will be migrated to 64-bit. It should not be run on a 64-bit instance. Take a backup of the database and index directory from V8 system. While doing the backup ensure that metafile with extensions .an,.as and .tf are backed-up properly.

Migration steps
  1. Prepare the database by dropping DATALINKS user defined functions in the Db2 Version 8 database:
    db2 Drop Specific Function DB2Ext.DataLinkContent1 
    db2 Drop Specific Function DB2Ext.DataLinkContent1
    db2 Drop Specific Function DB2Ext.DataLinkContent2
    db2 Drop Specific Function DB2Ext.DataLinkContent4
    db2 Drop Specific Function DB2Ext.DataLinkContent3
    db2 Disconnect all
    
  2. Migrate the 32-bit index files to 64-bit using the ctemigridx migration tool. See steps to run the tool on V9 32-bit machine for details.
  3. Take a backup of the database and index files from the 32-bit instance.
  4. Move the backed-up files and database to the target machine where 64-bit Db2 Version 9.1 or Version 9.5 is installed.
  5. Before migrating Net Search Extender indexes to the target machine, migrate the required Net Search Extender databases to the target machine.
  6. Restore the Net Search Extender indexes and the newly generated 64-bit metafile into the target machine by the following procedure:
    1. Issue the following command to stop Net Search Extender:
      db2text stop
    2. Restore the backup copies of the index directories to the same path as before.
    3. Issue the command to restart Net Search Extender:
      db2text start
  7. Migrate the Net Search Extender database to the current release.
    db2extmdb <database-name>
  8. Perform alter index by mentioning new index and work directories. The instance owner requires adequate permission to access and alter the index files.
    db2text alter index <index-name> for text index 
    directory <new_indexdir> work directory <new_workdir>
  9. Perform searches as before and verify whether the new migrated index is searchable.

Migrate index from V9 32-bit to V9 64-bit

This migration tool runs only on a 32-bit source Net Search Extender instance which will be migrated to 64-bit. It should not be run on a 64-bit instance. Take a backup of the database and index directory from a V9 32-bit system. While doing the backup ensure that metafile with extensions .an,.as and .tf are backed-up properly. The Db2 Version 9 32-bit to Version 9 64-bit migration can be performed in two different ways depending on whether or not the source and target machines are the same.

  • Source and target machines are different
    1. Migrate the working V9 32-bit database and Net Search Extender indexes to 64-bit using the ctemigridx migration tool. See steps to run the tool on V9 32-bit machine for details.
    2. Take a backup of the database and index files from the 32-bit instance.
    3. Move the backed-up files and database to the target machine where V9 is installed.
    4. Before migrating Net Search Extender indexes to Version 9 64-bit, migrate the required Net Search Extender databases to Db2 Version 9 64-bit.
    5. Restore the Net Search Extender indexes and the newly generated 64-bit metafile into the V9 64-bit setup by the following procedure:
      1. Issue the following command to stop Net Search Extender:
        db2text stop
      2. Restore the backup copies of the index directories to the same path as before.
      3. Issue the command to restart Net Search Extender:
        db2text start
    6. Migrate the Net Search Extender database to the current release.
      db2extmdb database-name
    7. Perform alter index by mentioning new index and work directories. The instance owner requires adequate permission to access and alter the index files.
      db2text alter index index-name for text index 
      directory new_indexdir work directory new_workdir
    8. Perform searches as before and verify whether the new migrated index is searchable.
  • Source and target machines are the same
    The following sequence of steps describe how to migrate a working V9 32-bit database and Net Search Extender indexes to a 64-bit Windows machine:
    1. Migrate the 32-bit index files to 64-bit using the ctemigridx migration tool. See steps to run the tool on V9 32-bit machine for details.
    2. Migrate the Db2 instance and database from V9 32-bit to V9 64-bit.
    3. Migrate the Net Search Extender database to the current release, using the db2extmdb command

Steps to run the tool on V9 32-bit machine:

  1. Logon as the Db2 instance owner.
  2. Extract the NSE_32_64_Idx_Migr_Tool_WINDOWS.zip archive CD to the NSE_32_64_Idx_Migr_Tool_WINDOWS directory. Make sure that Db2 instance is up and running and Net Search Extender is stopped. Ensure that no other process is attempting to get an exclusive lock on the index files located in the index directory.
  3. Run the batch file ctemigridx.bat file. The script can be run in two different modes.

    Mode 1 will establish a database connection and queries all data that is needed from the Net Search Extender database tables. This mode takes a database name as argument, and automatically determines all existing indexes in that database and offers to migrate them all at once, or selectively. After that it shows a list of indexes that are ready to get migrated. You can choose one index or all listed indexes. Adding the -check parameter to the command will perform all the necessary steps without the migration.
    ctemigridx -dbname sample
    Mode 2 can be used to migrate a particular index, if you know the indexname already and want to target the migration of this index. This mode is useful if you have a large number of indexes and want to avoid going through a long menu of indexes. It is also handy if you are running repeated tests with an individual index.
    ctemigridx -i index_identifier -p index_directory -[showmap]  
    The index directory has to be specified in the same way as it is used at index creation time. The index directory always has a NODE0000 subdirectory which then contains the index itself. Currently the script only supports single-node-systems. If you add the -showmap flag, the logfile will show a dump of the migrated index attribute for additional verification.
    ctemigridx -i IX123456 -p D:\sqllib\db2ext\indexes -showmap
  4. When the Net Search Extender index migration is done, some *.32 files can be found in the index directory. According to the indexes that have been migrated these new files can be found as follows:
    • IX123456.as.32 (Backup of the old 32 bit IX123456.as file)
    • IX123456.an.32 (Backup of the old 32 bit IX123456.an file)
    • IX123456.tf.32 (Backup of the old 32 bit IX123456.tf file)
    The migration creates a temporary directory that is created during migration. In case it is not there, a TMP_IX123456 directory can be found inside the Net Search Extender index directory.
  5. After verification of the 64-bit Net Search Extender indexes, the *.32 files can be removed or transferred to another location for backup.

Index migration is complete. You can now perform the instance migration to 64-bit.