Troubleshooting Applications Manager Plugin database migration failure after service pack upgrade of OPM and APM plugin

Troubleshooting Applications Manager Plugin database migration failure after service pack upgrade of OPM and APM plugin

When upgrading OpManager from version 12.6.xxx to 12.7.xxx and updating the APM Plugin to 1651x, particularly when using Postgresql as the backend database, an essential one-time migration occurs. This migration involves moving our backend Postgresql from version 10.x to version 14.x. After updating the APM Plugin to 1651x, some users have reported issues with database migration when accessing the "Applications" tab. This error message appears: 
Sorry, we are unable to migrate Applications Manager Plugin databaseSorry, we are unable to migrate Applications Manager Plugin database

Follow the steps below to troubleshoot and resolve this issue.

Identifying the cause of the Migration Failure:

  1. Access OpManager DB Query tool:
    1. Click on the 
      Support Icon
       located in the top right corner of the OpManager GUI.
    2. If the DB Query tool is not visible, enable it by navigating to Settings -> System Settings within OpManager.
  2. Run the query:
SELECT * FROM AppManagerPGMigrationDetails
  1. Check the Status: In the query output, locate the "Status" column: 0 -> Success, 1 - Failure, 2 - Not yet migrated, 3 - In-progress
  2. Handling a Failure (Status 1): If the Status column indicates a failure (1), check the error message displayed in the COMMENTS column and follow the respective steps below based on the error message received.

Resolving Migration Failure:

ERROR : database "amdb" is being accessed by other users.

This error can occur when an old APM plugin process is still running and connected to the APM database or when a user is connected to the APM plugin database.

 To resolve this, follow these steps:
  1. Log in to the server where OpManager is installed with proper privileges and Stop OpManager (ensure that all related OpManager and AppManager plugin processes are terminated)
  2. Navigate to <OpManager_Home>/bin directory via admin/root command prompt
  3. Execute the StandAloneDBQueryExecutor.bat/sh script
  4. Provide the OpManager Super-admin password when prompted.
  5. After successful authentication, choose option 1 to execute "Insert/Delete/Update queries."
  6. Input the following update query
UPDATE AppManagerPGMigrationDetails SET STATUS = 2, ENDTIME=0, COMMENTS='' WHERE ID = 1;
  1. Exit the DB Query Executor
  2. Restart OpManager.
  3. After restarting OpManager, access the OpManager user interface (UI).
  4. Navigate to the "Applications" tab (or APM Plugin tab).
  5. Check the progress of the database migration, ensuring it proceeds without errors.
  6. If migration fails again, provide the following to Support team (appmanager-support@manageengine.com)
    1. A complete zip of the logs folder located at <OpManagerHome>/logs
    2. A CSV export of the DB Query result from the 'Submit DB Query' page. Be sure to select the maximum number of rows before exporting, using the drop-down menu, and execute the query 'Select * from AppManagerPGMigrationDetails'
StandAloneDBQueryExecutor example


                  New to ADManager Plus?

                    New to ADSelfService Plus?