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 database
Follow the steps below to troubleshoot and resolve this issue.
Identifying the cause of the Migration Failure:
- Access OpManager DB Query tool:
Click on the
Support Icon located in the top right corner of the OpManager GUI.
- If the DB Query tool is not visible, enable it by navigating to Settings -> System Settings within OpManager.
- Run the query:
SELECT * FROM AppManagerPGMigrationDetails
- Check the Status: In the query output, locate the "Status" column: 0 -> Success, 1 - Failure, 2 - Not yet migrated, 3 - In-progress
- 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:
- 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)
- Navigate to <OpManager_Home>/bin directory via admin/root command prompt
- Execute the StandAloneDBQueryExecutor.bat/sh script
- Provide the OpManager Super-admin password when prompted.
- After successful authentication, choose option 1 to execute "Insert/Delete/Update queries."
- Input the following update query
UPDATE AppManagerPGMigrationDetails SET STATUS = 2, ENDTIME=0, COMMENTS='' WHERE ID = 1;
- Exit the DB Query Executor
- Restart OpManager.
- After restarting OpManager, access the OpManager user interface (UI).
- Navigate to the "Applications" tab (or APM Plugin tab).
- Check the progress of the database migration, ensuring it proceeds without errors.
- If migration fails again, provide the following to Support team (appmanager-support@manageengine.com)
- A complete zip of the logs folder located at <OpManagerHome>/logs
- 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 ADSelfService Plus?