Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Renaming Glassfish Application Server's Domain Name

DZone's Guide to

Renaming Glassfish Application Server's Domain Name

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

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.

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}