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%: C:\Program Files\Ricoh\ProcessDirector
    • %AIWDATA%: C:\aiw\aiw1

To migrate your data from DB2 to PostgreSQL:

  1. Log in to the primary computer using the RICOH ProcessDirector administrator account.
  2. Open a command prompt as an administrator.
    Even if you are logged on to your system as an administrator, you must start the command prompt by selecting Run as administrator from the right-click menu.
  3. Make sure that you can access both the DB2 and PostgrSQL databases.
    1. Open the DB2 command window by typing: db2cw.bat
    2. To check for DB2, type in the DB2 command window: db2 connect to aiwdb
    3. To check for PostgreSQL:
      • In the Windows Control Panel, click Administrative Tools.
      • Find the PostgreSQL service and see whether it is running.
  4. Prepare a migration directory.
    1. Create a temporary directory for the migration. For example, %AIWDATA%\tmp\migrateDb2ToPostgresql.
    2. Navigate to %AIWPATH%\base\packages.
    3. Copy migrateDb2toPostgresql-version.zip to your temporary migration directory and unzip.
  5. Run the migration tool.
    1. Stop the RICOH ProcessDirector service.
      Note: If the service is already stopped, start and then stop the service to ensure PostgreSQL is running. See Starting and stopping the RICOH ProcessDirector service for more information.
    2. Open a command prompt as an administrator. Run ippdprofile and type the script name: migrateDb2ToPostgresql.pl.
    The migration starts by restarting the activation to create tables in the 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\react-logs.log and %AIWPATH%\logs\installer\migrateDb2ToPostgresql.log.
    • If you see error messages during the migration, see Troubleshooting data migration errors.
  6. Restart the RICOH ProcessDirector service to apply the changes.
  7. 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.
  8. After you verify everything, proceed with uninstalling the DB2 database.
  9. To uninstall DB2:
    1. Click the Windows Start button and type services to search for the Services App. Open the Services App, then find DB2 - DB2COPY1 – AIWINST-0 and check the status. If it is running, stop this service.
    2. Start a command prompt as an administrator. Even if you are logged on to your system as an administrator, you must start the command prompt by selecting Run as administrator from the right-click menu.
    3. To open the DB2 command window, type: db2cw.bat
    4. Enter these commands in the DB2 command window to delete the aiwinst instance:
      • cd %AIWPATH%
      • cd db\BIN
      • db2idrop aiwinst
    5. Click the Windows Start button and type Apps & features to find the installed apps. Look for the DB2 Server Edition - DB2COPY1 and uninstall it.
    6. Remove the following directories if they exist:
      • Install_drive:\AIWINST
      • %AIWDATA%\db2_logs
  10. Continue with Completing the upgrade process.