Change database connection without browser access
Problem
Your server address or credentials for the administration database changed and you need to adjust them without being able to log in to the iGrafx Platform administration interface.
You will find an entry in the file igrafx_server.log that looks like the following example:
2016-08-08 14:13:15 ERROR DatabaseManager - Testing database connection "DatabaseConnectionInfo{id=0, oracleSid=, databaseUsername=USER_NAME, hostname=localhost, port=1433, databaseName=REPOSITORY_NAME, schemaName=, tablePrefix=, databaseType=MSSQL, jndiUrl=null}" failed
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user 'USER_NAME'.)
Step-by-step guide
Open the file dbconfig.xml you find in your basedirectory in a text editor. It will look similar to this:
CODE<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <dbconfig> <databaseName>Name_of_iGrafxAdminDB</databaseName> <databasePassword>???enc???8fB9eFU9ApA</databasePassword> <databaseType>MSSQL</databaseType> <databaseUsername>???enc???7si0eFU0CpA</databaseUsername> <hostname>Name_or_IP_of_SQL\Name_of_Instance</hostname> <id>0</id> <jdbcDriverClass></jdbcDriverClass> <oracleSid></oracleSid> <poolInitialSize>0</poolInitialSize> <poolMaxActive>20</poolMaxActive> <poolMaxIdle>10</poolMaxIdle> <poolMaxWait>-1</poolMaxWait> <port>1433</port> <schemaName></schemaName> <tablePrefix>Adm</tablePrefix> </dbconfig>
Adjust the fields you need to change. If you need to change an encrypted field you can replace it with clear text like:
CODE<databasePassword>???enc???8fB9eFU9ApA</databasePassword> change to: <databasePassword>MyPassword</databasePassword>
- Restart the application server.
- Open the browser and go to Administration > Server Settings > Database Settings and enter your database password.
- Click Save Changes and the dbconfig.xml file will be saved with encrypted parameters.