Geekflare is supported by our audience. We may earn affiliate commissions from buying links on this site.
In Development Last updated: November 30, 2022
Share on:
Invicti Web Application Security Scanner – the only solution that delivers automatic verification of vulnerabilities with Proof-Based Scanning™.

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.

  • Chandan Kumar
    Author
    As the founder of Geekflare, I’ve helped millions to excel in the digital realm. Passionate about technology, I’m on a mission to explore the world and amplify growth for professionals and businesses alike.
Thanks to our Sponsors
More great readings on Development
Power Your Business
Some of the tools and services to help your business grow.
  • Invicti uses the Proof-Based Scanning™ to automatically verify the identified vulnerabilities and generate actionable results within just hours.
    Try Invicti
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.
    Try Brightdata
  • Monday.com is an all-in-one work OS to help you manage projects, tasks, work, sales, CRM, operations, workflows, and more.
    Try Monday
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.
    Try Intruder