Upgrading to GlassFish v3
By user12611203 on Jan 20, 2010
As you probably know by now, Java EE 6 has 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 GlassFish v3, 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 predomain Domain needs to be upgraded before it can be started. Attempting upgrade now... Upgrade was successful, starting domain... Waiting for DAS to start ...... Started domain: domain1 Domain location: /Users/bobby/servers/glassfishv3/glassfish/domains/predomain Log file: /Users/bobby/servers/glassfishv3/glassfish/domains/predomain/logs/server.log Admin port for the domain: 4848 Command 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 have
installed any 3rd party jars in your
glassfish/lib directory (as opposed to the domain's lib dir), you should move those
over to your v3 installation as well. In fact, the above is exactly what the asupgrade tool does for you in v3. It will copy
over the source domain, making sure not to clobber anything if there is a name collision. It will look for jars to move over, and then
asadmin start-domain --upgrade <your_domain>. Be sure to check the server.log file for information
on 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 and Java EE 6.