Before you connect to Applications Manager's back-end database, it is important that you take a backup of the Applications Manager directory so that you don't make any changes/accidentally modify the database.
Identify which database Applications Manager is using. Navigate to <Applications Manager Home>\conf\ directory and open AMServer.properties file. Check the value of am.dbserver.type variable. If it is MySQL, you will migrate to a different database as Applications Manager does not support MySQL anymore (from v16240). If it is PostgreSQL, follow the steps given below:
PostgreSQL database
Applications Manager Standalone
Connect to the PostgreSQL database through the following commands one by one from the server in which Applications Manager has been installed:
Windows
For Applications Manager v16670 & above:
1. Open command terminal, then navigate to the <Applications Manager Home>\bin directory and execute the following command:
DBConfiguration.bat -u dbuser
2. Then navigate to <Applications Manager Home>\working\pgsql\bin directory and execute the following command:
psql -p 15432 -U dbuser -h localhost -d amdb
For Applications Manager v16660 & below:
1. Open command prompt and navigate to the following directory:
<Applications Manager Home>\working\pgsql\bin
2. Execute the following commands one by one:
set PGPASSWORD=appmanager
psql -p 15432 -U postgres -h localhost -d amdb
Note: In the above commands, "amdb" is the name of the database of Applications Manager.
15432 is the port on which Applications Manager's PGSQL database runs (you can get this value from <Applications Manager Home>\conf\AMServer.properties file, by checking the value of am.db.port variable ). Sample screenshot:
For Applications Manager v16670 & above:
1. Open command terminal, then navigate to the <Applications Manager Home>\bin directory and execute the following command:
. ./DBConfiguration.sh -u dbuser
2. Then navigate to <Applications Manager Home>\working\pgsql\bin directory and execute the following command:
./psql -p 15432 -U dbuser -h localhost -d amdb
For Applications Manager v16660 & below:
1. Open terminal and navigate to the following directory:
<AppManagerHome>/working/pgsql/bin
2. Execute the following commands one by one.
export PGPASSWORD=appmanager
./psql -p 15432 -U postgres -h localhost -d amdb
Note: In the above commands, "amdb" is the name of the database of Applications Manager.
15432 is the port on which Applications Manager's PGSQL database runs (you can get this value from <Applications Manager Home>\conf\AMServer.properties file, by checking the value of am.db.port variable ). Sample screenshot:
APM Plugin (Applications Manager Plugin installed on OpManager)
1. Open command prompt/terminal and navigate to <OpManager home>/pgsql/bin directory.
2. Execute the following command:
Windows:
psql -p 13306 -U postgres -h localhost -d amdb
Linux:
./psql -p 13306 -U postgres -h localhost -d amdb
Note: Follow the below steps to connect to the Applications Manager plugin DB if OpManager's PostgreSQL DB has been upgraded to version 12.5.xx :
1. Connect to the OpManager DB using the below command:
psql.exe -U dbuser -h 127.0.0.1 -p 13306 <OpManager DB Name> 2. Then enter the password for user dbuser.
Note: The database password for the user dbuser is uniquely encrypted for each installation. To obtain the database password for dbuser the following files from the OpManager installation will be required.
i) <OpManager home>\conf\database_params.conf (value of password for dbuser from this file will be used)
ii) <OpManager home>\conf\customer-config.xml (value of CryptTag from this file will be used)
These files must be shared with a support technician, who will decrypt the dbuser password for you to connect to the Applications Manager plugin database.
3. Once connection to the database is successful, to list the databases inside the OpManager DB, enter the following command:
\l
4. After checking Applications Manager's plugin database name, enter the following command:
\c <DB name>
Example: \c amdb
5. Now it will connect to the Applications Manager plugin database.
MySQL Database (Now deprecated)
Windows:
1. Open command prompt. Navigate to the following directory:
<AppManagerHome>\working\mysql\bin
2. Execute the following command:
mysql.exe -h localhost -u root -P 13326 -pappmanager -D AMDB -A
Note: In the above commands, AMDB is the name of the database of Applications Manager.
13326 is the port on which Applications Manager's MySQL database runs (you can get this value from <Applications Manager Home>\conf\AMServer.properties file, by checking the value of am.db.port variable ).
Linux:
1. Open terminal. Navigate to the following directory:
<AppManagerHome>/working/mysql/bin
2. Execute the following command:
mysql -h localhost -u root -pappmanager --socket=./../mysql.sock -D AMDB -A
Note: In the above commands, AMDB is the name of the database of Applications Manager.
Sample screenshot:
Troubleshooting PostgreSQL Connection refused error
In the Applications Manager server, please open the WordPad with admin rights and open the hosts file present under C:\Windows\system32\drivers\etc\ directory (or under /etc directory in case of Linux), then uncomment by removing the hash (#) symbol as shown below and save it.
# 127.0.0.1 localhost
to
127.0.0.1 localhost
In the same location if you have IPV6 entry in hosts file, comment that and save the file.
# ::1 localhost
In the same location if you have IPV6 entry in hosts file, comment that and save the file.
#::1 localhost6.localdomain6 localhost6