DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • A Maven Story
  • Java EE 6 Pet Catalog with GlassFish and MySQL
  • Request Routing Through Service Mesh for WebSphere Liberty Profile Container on Kubernetes
  • How to Use JMS ActiveMQ With Mule 4: Part 1

Trending

  • Evolving Spring Boot APIs to an Event-Driven Mesh
  • Agentic AI Design Patterns and Principles: Building Autonomous, Collaborative Systems
  • Comparing Top Gen AI Frameworks for Java in 2026
  • Bringing Intelligence Closer to the Source: Why Real-Time Processing is the Heart of Edge AI
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Renaming Glassfish Application Server's Domain Name

Renaming Glassfish Application Server's Domain Name

By 
Sam  Sepassi user avatar
Sam Sepassi
·
Feb. 11, 14 · Interview
Likes (1)
Comment
Save
Tweet
Share
16.2K Views

Join the DZone community and get the full member experience.

Join For Free

Renaming domain names is not supported by Glassfish application server. There is no toolkit or any command available by Glassfish to perform domain name rename. You can choose your desired domain name when you install glassfish 3.x, but Glassfish 4 doesn’t let you choose your desired domain name (auto selecting domain1 for domain name). Without diving into domain configuration files or messing with domain XML files, the rename operation can be done quickly and cleanly. In case another name is required for currently operating Glassfish domain, follow these simple steps:

Steps are so easy and simple:

1.  Execute asadmin utility of your Glassfish distribution.

2.  Stop your domain if it’s running by issuing stop-domain <YOUR DOMAIN NAME> command.

3.  Run backup-domain <YOUR DOMAIN NAME>.

4.  After executing the backup domain command, your backed up domain is located under glassfish_ home/domains/<YOUR DOMAIN NAME>/backups  directory a .zip file.

5.  Copy the generated .zip backup file to other location.

6.  Now delete your existing domain by issuing delete-domain <YOUR DOMAIN NAME> command. Don’t worry you have already backed up your domain settings, remember?

7.  Open your backup file, normally packaged as a zip file. Open the backup.properties file and change the domain.name property to your desired name.

8.  Save the file and make sure that the modification is applied to your zip file too.

9.  Bring up asadmin utility up and issue the following command

restore-domain  domain1 --filename <PATH TO BACKUP ZIP FILE> --force

10.  Execute list-domains command to see your domain with its new name.

That's it. Your domain name is changed and your settings are restored as well.

GlassFish Application server application

Opinions expressed by DZone contributors are their own.

Related

  • A Maven Story
  • Java EE 6 Pet Catalog with GlassFish and MySQL
  • Request Routing Through Service Mesh for WebSphere Liberty Profile Container on Kubernetes
  • How to Use JMS ActiveMQ With Mule 4: Part 1

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook