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:
2. Stop the domain:
3. Back up the domain.
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.
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
Leave a Reply