Migrating data from DB2 to PostgreSQL

If you previously used RICOH ProcessDirector with DB2 and are migrating to the PostgreSQL database configuration, you must migrate your data from one database to the other after installing the update.
After the upgrade, RICOH ProcessDirector is still running on the DB2 database.
    Note:
  • This procedure assumes that you installed RICOH ProcessDirector in the default location. If you installed in a different location, paths to files and scripts must be adjusted to your installation.

    The default paths are:

    • $AIWPATH: /opt/infoprint/ippd
    • $AIWDATA: /aiw/aiw1

To migrate your data from DB2 to PostgreSQL:

  1. Log in to the primary computer as the RICOH ProcessDirector system user (aiw1 is the default).
  2. Make sure that you can access both the DB2 and the PostgreSQL databases. Open a command line and enter these commands.
    • To check for DB2 enter: db2 connect to aiwdb

      If no connection info is returned, enter: db2start and check the status again.

    • To check for PostgreSQL, enter: docker info
  3. Prepare a migration directory.
    1. Create a temporary directory for the migration. For example: mkdir $AIWDATA/tmp/migrateDb2ToPostgresql
    2. Navigate to: $AIWPATH/base
    3. Copy the migrateDb2toPostgresql-version.zip to your temporary migration directory and unzip.
    4. In your temporary migration directory, update the permissions for migrateDb2ToPostgresql.pl
      Type: chmod +x migrateDb2ToPostgresql.pl
    5. Update the permissions for rexact.pl.
      Type: chmod +x rexact.pl
  4. Run the migration tool.
    1. Stop RICOH ProcessDirector, except the database: stopaiw -d
    2. Log in as the root user.
    3. Run . /opt/infoprint/ippd/base/config/ippdprofile
    4. From the migration directory, run the migration script: ./migrateDb2ToPostgresql.pl

    The migration starts by restarting the activation to create tables in PostgreSQL database. Activation status messages are displayed.

    When the activation is complete, the script runs the migration. As the migration script runs, you should see status messages such as: Migrating table <tablename>

      Note:
    • Additional log messages are written to: $AIWPATH/logs/installer/rexact-logs.log and $AIWPATH/logs/installer/migrateDb2ToPostgresql.log
    • If you see error messages during the migration, see Troubleshooting data migration errors.
  5. Stop and restart RICOH ProcessDirector:
    1. Log in as the RICOH ProcessDirector system use (aiw1 is the default).
    2. Run stopaiw
    3. Run startaiw
  6. Log in to RICOH ProcessDirector. All objects and jobs should now appear on the Main page.
      Note:
    • You can see extra jobs in the system if sample input devices are enabled while the migratingDb2ToPostgresql.pl script runs. The script reactivates and submits jobs to the sample input devices.
  7. After you verify everything, proceed with uninstalling the DB2 database.
  8. To uninstall DB2:
    1. Log in as the root user.
    2. Enter these commands to uninstall DB2 database.
      • cd $AIWPATH/db_version/instance
      • ./db2idrop aiwinst
      • cd $AIWPATH/db_version/install
      • ./db2_deinstall –a
    3. Remove the following directories if they exist:
      • $AIWDATA/db2
      • $AIWDATA/db2_logs
  9. Continue with Completing the upgrade process.