WebSphere Application Server version 6.0 has a wonderful feature that lets you take a snapshot of the current configuration. This is described in Backing up and restoring administrative configurations in the WebSphere Application Server version 6.0 InfoCenter. The idea is that you can use the
backupConfigcommand to create an archive (ZIP file) of a node's configuration. The backup contains everything you need to know about the node including the XML configuration files and the deployed applications. You can use this backup to completely restore a configuration using the
restoreConfigcommand. So... you can take a backup, mess around with your configuration, and then optionally restore it if necessary (the InfoCenter entry for
backupConfigwarns that the command does not save file permissions or ownership information which means that a restore may not exactly be trivial).
Frankly, this functionality is great for environments that tend to get messed around a lot. I know that I tend to use these commands when I'm trying out new stuff. That's a huge part of my job: I need to know how all this stuff works so I have to mess around with it and tend to wreck my configuration regularly. On my laptop,
restoreConfigwork wonders. Of course, I also tend to just build a lot of new profiles and start over a lot as well (I do like the profiles).
The big question is this: should you use these commands on your production runtime environment? And, of course, the answer is "it depends". I posed this question to my ISSW colleagues which ignited a lengthy and very interesting chat (it was either this or chat about "Batman Begins"). In the end, it came down to this: use scripts. If you really need to have full understanding of your configuration you should have one or more scripts that you can use to build it and rebuild it from scratch if necessary. The alternative is for you to remember all the buttons you pressed and values you typed using the console and hope that you can repeat that effort. If you use scripts, then you can simply rerun them to rebuild your configuration. And the scripts can be put into a version control system (along with EAR files and other resources) which helps to answer the original question. You rollback your configuration by obtaining and running a previous version of the script.
Of course, building good scripts will take time and effort. In the end, it'll likely save you a lot of grief. Oh, and remember: keep it simple. Your scripts may need to be migrated at some point.[Read More]