Steve Liem, Uncategorized

As applications get deployed, undeployed, and redeployed, and as you experiment with different server configuration settings, there may be times when your server gets into a confused or unstable state. In such cases, it is useful to have a previously saved working configuration on which to fall back. This is not problem solving, per se, but rather a way to avoid problems in the first place.

The Glassfish configuration contains data about:

* deployed applications,
* the file realm,
* security certificates,
* other resource and server configuration settings.

The Application Server asadmin command includes a backup-domain option that backs up the domain(s) you specify. Use this option to take periodic “snapshots” of your server configuration. Then, if necessary, use the restore-domain option to restore one or more domains to a known working state. Refer to the Application Server Administration Guide for complete instructions on using the asadmin backup-domain and restore-domain options. Use the following procedure to backup and restore a server configuration:

To back up and restore a server configuration

1. Start the Application Server. Go to the /bin directory of Glassfish and run the command:

asadmin start-domain domain1

2. Stop the domain:

asadmin stop-domain domain1

3. Back up the domain.

asadmin backup-domain domain1

Backed up directories are stored by default in the install_dir/backups directory.

4. Make changes to the Application Server configuration and/or domain(s), as desired.

5. If necessary, restore the server and/or domain configuration to the state saved in Step 3, above.

asadmin restore-domain –filename domain1

If it is necessary to do a complete re-installation of Glassfish, please keep the following sequence in mind:

1. Backup the old domain
2. Do a new install on a new location
3. Copy/paste the backup file to the new domain
4. Restore the backup
5. Test if everything works fine
6. Dump the old Glassfish installation


2 Comments on “Restoring your Glassfish configuration”

  1. Bård Tørustad said at 12:09 on April 2nd, 2010:

    Hi,

    Can I restore the backup on another server (like in another datacentre) just like that and subsequently adapt the configuration to the new environment (different servernames etc)?

    Thanks and regards,
    Bård Tørustad

  2. Steve Liem said at 08:16 on April 16th, 2010:

    Hi. The backup of a domain includes everything you need for the DAS to recognize the configuration of that domain. So it should recognize the backup file on another DAS / Machine. The backup is like a hardcopy of the complete domain map inside the glassfish container.


Leave a Reply