Friday, September 25, 2015

Resolve issue for Forgotten Weblogic Console Password

In case you have lost the administrator password and now you can’t get into the system. NO need to worry,you can still log in to the Web Logic Server console by creating a new administrator account.

Step 1) Shut down the WebLogic Server (Admin Server + Manage Server ) instance, if it’s running.

$cd $MW_HOME/user_projects/domains/$DOMAIN_NAME/bin
$./stopWebLogic.sh

Step 2) Set all environment variables.

$cd $MW_HOME/user_projects/domains/$DOMAIN_NAME/bin
$ ./setDomainEnv.sh

Step 3) Since it’s a critical file, back up the DefaultAuthenticatorInit.ldift file under the /security
directory.

$cd $MW_HOME/user_projects/domains/$DOMAIN_NAME/security/
$mv DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit.ldift_ORG

Step 4) Change to the /security directory and execute below command

$cd $MW_HOME/user_projects/domains/$DOMAIN_NAME/security/

 SYNTAX:
$java weblogic.security.utils.AdminAccount newAdmin newPassword .
EXAMPLE:
$java weblogic.security.utils.AdminAccount weblogic Weblogic1 .

NOTE:- There is a . (DOT) at the end of the Above command which represents the Current Directory. Here you can see that after
this command Executes A new “DefaultAuthenticatorInit.ldift” file will be created in the Current Directory.

Step 5) Take backup of tmp,data,cache and logs for admin server and all manage server in the domain.

$cd $MW_HOME/user_projects/domains/$DOMAIN_NAME/servers/AdminServer
mv logs logs_BKP
mv tmp tmp_BKP
mv cache cache_BKP
mv data data_BKP


Step 6) Take backup of boot.properties file

$cd $MW_HOME/user_projects/domains/$DOMAIN_NAME/servers/AdminServer/security
mv boot.properties boot.properties_BKP


Step 7) Create new boot.properties files as below .Give user name and password given in Step 4


vi boot.properties
username=weblogic
password=Weblogic1
Esc :
wq!

Step 8) Start Weblogic Admin Server

$cd $MW_HOME/user_projects/domains/$DOMAIN_NAME/bin
$nohup ./startWeblogic.sh &


Note:

The above worked for our env.but before trying on your environment please make sure that you have taken sufficient backup to avoid any issue.
Also above will work only if you are using DefaultAuthenticator as LDAP.
In case you are using some external LDAP authentication (OID) then above steps wont work.


No comments:

Post a Comment

Other Posts