As you probably know by now, Java EE 6has made life simpler for developers (ear files not required, local EJB interfaces optional, singletons, all good stuff!). But of course you want to run your old applications as well. With GlassFishv3, moving them over to the newest application server is also a lot easier. In fact, you can upgrade a domain from GlassFish v2.1 or GlassFish v3-Prelude in zero steps. It doesn't get easier than zero, at least until the JSR for "Java API for Mind Reading" gets implemented.

By "zero steps," I mean you can simply start GlassFish v3 with an older domain and it will recognize the domain version and attempt to upgrade it before proceeding with startup. Below is the kind of output you'll see. In this case I've copied a v3-Prelude domain over to my v3 installation and called it "predomain" to not clobber my existing domain1.

hostname% asadmin start-domain predomainDomain needs to be upgraded before it can be started.Attempting upgrade now...Upgrade was successful, starting domain...Waiting for DAS to start ......Started domain: domain1Domain location: /Users/bobby/servers/glassfishv3/glassfish/domains/predomainLog file: /Users/bobby/servers/glassfishv3/glassfish/domains/predomain/logs/server.logAdmin port for the domain: 4848Command start-domain executed successfully.Now before you start upgrading all your previous domains, you should remember that only developer profiles are supported in v3 --clustering will come later. You should make a copy of your existing domain and upgrade that domain to be safe. Also, if you haveinstalled any 3rd party jars in your glassfish/lib directory (as opposed to the domain's lib dir), you should move thoseover to your v3 installation as well. In fact, the above is exactly what the asupgrade tool does for you in v3. It will copyover the source domain, making sure not to clobber anything if there is a name collision. It will look for jars to move over, and thenwill run asadmin start-domain --upgrade . Be sure to check the server.log file for informationon the upgrade, especially in case there were warnings or errors.

Check out the Upgrade Guide for more information on upgrading,especially the sections on which previous server version are compatible and notes on application compatibility between Java EE 5 andJava EE 6.