If you are working on migration environment where often you need to rename the domain name then this guide will help you.

Changing WebLogic domain name is possible with modifying certain files under your domain. This, I tested in a development environment and worked well for me. In this exercise – I have renamed from base_domain to new_domain

  • Take complete backup of your domain
  • Copy old domain name folder to new domain name
cp –rp base_domain new_domain
  • Search all files which contain base_domain in newly copied folder
bash-3.2$ pwd /Users/chandan/weblogic/new_domain
chandan$ grep -r * base_domain --exclude-dir={tmp,logs,data,domain_bak}  base_domain/bin/setDomainEnv.sh:DOMAIN_HOME="/Users/chandan/weblogic/base_domain"  base_domain/bin/setDomainEnv.sh:LONG_DOMAIN_HOME="/Users/chandan/weblogic/base_domain"  base_domain/bin/startManagedWebLogic.sh:DOMAIN_NAME="base_domain"  base_domain/bin/startManagedWebLogic.sh:DOMAIN_HOME="/Users/chandan/weblogic/base_domain"  base_domain/bin/startWebLogic.sh:DOMAIN_HOME="/Users/chandan/weblogic/base_domain"  base_domain/bin/stopManagedWebLogic.sh:DOMAIN_HOME="/Users/chandan/weblogic/base_domain"  base_domain/bin/stopWebLogic.sh:DOMAIN_HOME="/Users/chandan/weblogic/base_domain"  base_domain/config/config.xml:  <name>base_domain</name>
base_domain/config/config.xml:    <name>base_domain</name>
base_domain/config/config.xml:    <name>base_domain</name>
base_domain/init-info/startscript.xml:                              <value>/Users/chandan/weblogic/base_domain</value>
base_domain/init-info/startscript.xml:                              <value>/Users/chandan/weblogic/base_domain</value>
base_domain/init-info/startscript.xml:                              <value>/Users/chandan/weblogic/base_domain</value>
base_domain/init-info/startscript.xml:                              <value>base_domain</value>  base_domain/init-info/startscript.xml:                              <value>/Users/chandan/weblogic/base_domain</value>
base_domain/init-info/startscript.xml:                              <value>/Users/chandan/weblogic/base_domain</value>
base_domain/init-info/startscript.xml:                              <value>/Users/chandan/weblogic/base_domain</value>
base_domain/init-info/startscript.xml:                              <value>/Users/chandan/weblogic/base_domain</value>
base_domain/init-info/tokenValue.properties:@DOMAIN_HOME=/Users/chandan/weblogic/base_domain  base_domain/init-info/tokenValue.properties:@DOMAIN_NAME=base_domain
base_domain/init-info/tokenValue.properties:@USERDOMAIN_HOME=/Users/chandan/weblogic/base_domain  base_domain/startWebLogic.sh:DOMAIN_HOME="/Users/chandan/weblogic/base_domain"
chandans-imac:weblogic chandan$
  • Modify base_domain to new_domain in all above files. You can use sed to modify or manually you can do one by one. The choice is yours.
grep -r base_domain * --exclude-dir={tmp,logs,data,domain_bak} | xargs sed –I ‘s/base_domain/new_domain/g’
  • Ensure none of the files are having base_domain
bash-3.2$ grep -r base_domain * --exclude-dir={tmp,logs,data,domain_bak}
  • Go to AdminServer folder and delete cache, data, tmp folder
bash-3.2$ pwd /Users/chandan/weblogic/new_domain/servers/AdminServer
bash-3.2$
bash-3.2$ rm -rf cache/ data/ tmp/
bash-3.2$
  • Go to your New Domain and start Weblogic
chandans-imac:bin chandan$ pwd  /Users/chandan/weblogic/new_domain/bin
chandans-imac:bin chandan$
bash-3.2$ ./startWebLogic.sh
<Jan 8, 2013 11:32:53 PM SGT> <Notice> <WebLogicServer> <BEA-000329> <Started WebLogic Admin Server "AdminServer" for  domain "new_domain" running in Production Mode>
<Jan 8, 2013 11:32:53 PM SGT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<Jan 8, 2013 11:32:53 PM SGT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

That’s all! I started WebLogic managed server as well with no issues.

Reader Interactions

Comments

  1. It doesn’t work in WLS 12c

    <A logging last resource (LLR) failed during initialization. The server cannot boot unless all configured LLRs initialize. Failing reason:
    javax.transaction.SystemException: Failed to call registerLoggingResourceTransactions() weblogic.transaction.loggingresource.LoggingResourceException: weblogic.transaction.loggingresource.LoggingResourceException: java.sql.SQLException: JDBC LLR, table verify failed for table 'CS_CMS.WL_LLR_MYSERVER', row 'JDBC LLR Domain//Server' record had unexpected value 'aaa//myserver' expected 'bbb//myserver'*** ONLY the original domain and server that creates an LLR table may access it ***

    • Hello Lolcio, Thanks for visiting. I haven’t tested this in 12c however, by looking at logs it sounds like no permission to verify the table. Can you ensure configured database user can access CS_CMS.WL_LLR_MYSERVER table?

  2. hi Chandan,

    Am not sure this discussion is still active and looking or not! Giving a try

    I have a requirement of moving the location of the Fusion Middleware folder structure which includes weblogic server & wls domain.. Do you have standard steps for this?
    ex.. base FMW HOME is : /opt/appbin/oracle/iam_middleware
    new FMW Home is : /opt/appbin/oracle/R2/iam_middleware

    Thanks
    Srinivas

Comments

Your email address will not be published. Required fields are marked *