How to Change Admin Server Name in a WebLogic Server (WLS) Domain

Renaming the Admin Server in a WebLogic Server (WLS) domain involves using a WLST (WebLogic Scripting Tool) script in offline mode. Below is a detailed guide for performing this task.


Pre-requisites:

  • Domain Shutdown: Before starting the renaming process, ensure the entire WebLogic domain is completely shut down to avoid any conflicts or inconsistencies.
  • Backup: Take a full backup of the WebLogic domain directory to safeguard against any unintended changes.

Steps to Rename Admin Server

Step 1: Rename the Admin Server Using a WLST Script

  • Open a terminal or shell on the WebLogic server.
  • Start the WLST utility in offline mode. You can start it using the following command:

$WL_HOME/common/bin/wlst.sh

Replace $WL_HOME with the actual WebLogic installation directory.

Use the following sample WLST script to rename the Admin Server:


readDomain('path/to/domainDir') # Replace with your domain directory
cd('/Servers') # Navigate to the Servers section
cd('AdminServer') # Go to the AdminServer configuration
cmo.setName('NewAdminServerName') # Set the new name
updateDomain() # Save changes to the domain
exit() # Exit WLST
  • readDomain('path/to/domainDir'): Reads the domain configuration from the specified domain directory.
  • cmo.setName('NewAdminServerName'): Updates the Admin Server name to the new one. Replace 'NewAdminServerName' with your desired name.
  • updateDomain(): Saves the updated configuration.

Step 2: Update Domain Files and Folders

After successfully renaming the Admin Server, update the domain files and folder structure as follows:

Adjust Domain Scripts:

  • Open the $DOMAIN_HOME/bin directory.
  • Update all scripts (e.g., startWebLogic.sh, setDomainEnv.sh, and other custom scripts) that reference the old Admin Server name (AdminServer) to use the new name (NewAdminServerName).

Update Security Folder:

Move or rename the security folder associated with the Admin Server:

mv $DOMAIN_HOME/servers/AdminServer/security
$DOMAIN_HOME/servers/NewAdminServerName/security
This allows the renamed server to reuse the boot.properties file without needing to re-enter credentials.

Update Server Directory Structure:

Rename the Admin Server’s directory in the $DOMAIN_HOME/servers path:

mv $DOMAIN_HOME/servers/AdminServer
$DOMAIN_HOME/servers/NewAdminServerName

Optional Cleanup: Remove temporary subdirectories (tmp and cache)
in the renamed server directory:
rm -rf $DOMAIN_HOME/servers/NewAdminServerName/tmp rm -rf $DOMAIN_HOME/servers/NewAdminServerName/cache

Post-Renaming Checks

  1. Start the WebLogic domain and ensure that the renamed Admin Server starts successfully:

    $DOMAIN_HOME/bin/startWebLogic.sh
  2. Log in to the WebLogic Administration Console to verify that the Admin Server is functioning correctly with its new name.
  3. Test connectivity to the Admin Server and ensure all managed servers in the domain recognize the renamed Admin Server.



Please do like and subscribe to my youtube channel: https://www.youtube.com/@foalabs If you like this post please follow,share and comment