How to Recover Command Center lost Database Password

How to Recover Command Center lost Database Password

book

Article ID: CTX219257

calendar_today

Updated On:

Description

Objective: 
When Command center is running with separate Integrated database server for long time, There is a possibility that they forgot the Initial DB password set it on the Command center what configured on the Command center at initial stages. 

Error:
When try to upgrade the firmware of the command center using package file, During Upgrade, the wizard asks you to add the password of the existing connected integrated database server , If the password is incorrect it will through below error :

"login failed to Database user  'XYZ' " .  where 'XYZ' is database name.

Resolution

Command Center Database Reset Password :

Prerequisite : 

  • If the existing Database password is not working on command center, Assign a new password to the Database server first. 
  • Stop the command center service.


if Command Center running with MSSQL database on windows server follow the below steps:

Go to the below path :
1. <Command center home >/classes/hbnlib/hibernate.cfg.xml file.

User-added image

2. Edit the file hibernate.cfg.xml under below location:

User-added image
3. The password will be encrypted so we need to first convert new password into encrypted form. Run the following command to get the new encrypted password:

4. Go to the below path:

\Citrix\CitrixCommandCenter\bin\admintools>EncryptPassword.bat root public mynewpassword , where Example: mynewpassword is the new password that is going to be convert into encrypted form. 

User-added image

5. After the successful execution of the , Copied this encrypted password in hibernate.cfg.xml file and save the file with new DB password credentials.

6. Load the command center again and access the database using new password.

If Command Center running with  database MSSQL on Linux server follow the below steps:

Please follow the same prerequisite as follows above:


1. The file location gets changed if the command center is running on the Linux server, Please find the below path : 

User-added image

2. Edit the hibernate.cfg.xml file using vi editor under the location attribute.

User-added image

3. Once its done, run the EncryptPassword.sh tool and change the new password to the encrypted password. 

4. After the successful execution of the , Copied this encrypted password in hibernate.cfg.xml file and save the file with new DB password credentials.
 
5. Restart the command center again and access the database using new password.


Problem Cause

Issue: 
While doing a command center upgrade to the newer version using the package file, we are suppose to add the DB password credentials to connect with the same Database using the Old password and if we don't give the correct password the setup wizard will not allow to install the new version because while installation is done using package file the command center will synchronize with the database for the newer version validation check. 

Issue/Introduction

When user are trying to upgrade the NetScaler Command Center, and don't know the password for the DB User account. How to recover the lost DB password ?