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

Build vs Buy a Data Quality Solution: Which is Best for You? Gain insights on a hybrid approach. Download white paper now!

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.

Build vs Buy a Data Quality Solution: Which is Best for You? Maintaining high quality data is essential for operational efficiency, meaningful analytics and good long-term customer relationships. But, when dealing with multiple sources of data, data quality becomes complex, so you need to know when you should build a custom data quality tools effort over canned solutions. Download our whitepaper for more insights into a hybrid approach.

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}