
How to rename weblogic domain name?


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
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$ rm -rf cache/ data/ tmp/
- 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.
Learn more about Oracle Weblogic Administration here.
- Tagged in:
- Weblogic
More great readings on Sysadmin
-
5 System Center Configuration Manager (SCCM) Alternatives for Desktop and Server PatchingSatish Shethi on August 6, 2022
-
Best Privileged Access Management (PAM) Solutions in 2022Lakshman Sharma on August 6, 2022
-
Network Bandwidth Monitoring is Easy with these 6 ToolsAshlin Jenifa on July 31, 2022
-
9 Best Microsoft WSUS Alternative Patch Management Tools for SMBSatish Shethi on July 13, 2022
-
10 Popular Network Connectivity Methods to KnowAmrita Pathak on July 1, 2022
-
A Brief Guide About Windows Management Instrumentation (WMI)Satish Shethi on June 28, 2022
Join Geekflare Newsletter
Every week we share trending articles and tools in our newsletter. More than 10,000 people enjoy reading, and you will love it too.