Upgrading from Grails 1.3.9. to Grails 2.5.6.

Upgrading from Grails 1.3.9. to Grails 2.5.6.

Hi all,

So I'm upgrading the web application component of our company product from Grails 1.3.9 to Grails 2.5.6. It's been something we've not had the time to devote to until now, but can no longer afford not to.

So far I've done the following:- updated all dependency libraries and plugins to be Grails 2.x compatible.- modified controllers and services to accommodate new requirements (like changing methods to private/protected where necessary)- updated files installed by 'install-templates'- updated Config.groovy according to a sample 2.5.6. Config.groovy file- modified some Service's to use @Transactional to fix a circular dependency

So far, this has gotten me past a wide range of initial errors encountered. However now I'm stuck with 2 issues:

1. Startup of the application is extremely slow2. Startup doesn't actually complete as it throws an OutOfMemoryError on heap space

I've upped the -Xmx to 1G just to try accommodate that, but to no avail. So my question follows:

What other areas of a v1.3.9 application should I focus on (as in update/upgrade in version or convention) to eliminate possible problems that would manifest running it as v2.5.6.

Any feedback whatsoever would be appreciated, as I'm a little stuck now after scouring the Grails docs for possible conflicts.

Re: Upgrading from Grails 1.3.9. to Grails 2.5.6.

Hey Darryl

I've been working on a similar migration (1.3.x to 2.5.x) and would be happy to share my experience. Here's a ticket that encapsulates some of the post-migration testing I've been trying to do (https://github.com/openboxes/openboxes/issues/94). There are a bunch of migration guides and blog posts on the web (see the links at the top of that ticket above - the list is not comprehensive by any means). Unfortunately, I didn't have a ticket that includes the migration steps, I just followed some of the migration guides and kept notes somewhere. I believe I have documentation somewhere that highlights some of the major issues I resolved during the process. I'll try to publish that to the ticket (or on our wiki when I get a chance).

As far as I remember, the actual migration steps (most of the same steps you've taken and those) only took a few hours, maybe a day or two. I was able to get my project back up and running pretty quickly -- even bragged to my wife that it only took me a few hours to do. Then reality set in. From that point, the long slog has been fixing broken tests, migrating plugins that needed to be upgraded, and a few other really tedious things. Unfortunately, I only get to work on this particular project a few hours per month so it's taking forever, but it sounds like you're pretty close to the end.

1. Startup of the application is extremely slow2. Startup doesn't actually complete as it throws an OutOfMemoryError on heap space

It seems like your memory settings aren't getting picked up? In which environment are you seeing this behavior? Development? Or on a test server? Where are you setting the memory settings? In any case it sounds like 1G should be enough (unless it's doing a lot of object creation during startup) but I would inspect what command-line arguments are actually being used when running the application.

Assuming you're seeing this issue in your development environment on Linux, you can use the following command to see whether your memory config is being used by the grails process.

$ ps -aux | grep grails

If that's not the case, use whatever tools are at your disposal to inspect those arguments. If the memory settings are present, increase the heap memory. If not, try to figure out where Grails is expecting you to set those properties. If you answer the questions above and I can try to help you with that.

So I'm upgrading the web application component of our company product from Grails 1.3.9 to Grails 2.5.6. It's been something we've not had the time to devote to until now, but can no longer afford not to.

So far I've done the following:- updated all dependency libraries and plugins to be Grails 2.x compatible.- modified controllers and services to accommodate new requirements (like changing methods to private/protected where necessary)- updated files installed by 'install-templates'- updated Config.groovy according to a sample 2.5.6. Config.groovy file- modified some Service's to use @Transactional to fix a circular dependency

So far, this has gotten me past a wide range of initial errors encountered. However now I'm stuck with 2 issues:

1. Startup of the application is extremely slow2. Startup doesn't actually complete as it throws an OutOfMemoryError on heap space

I've upped the -Xmx to 1G just to try accommodate that, but to no avail. So my question follows:

What other areas of a v1.3.9 application should I focus on (as in update/upgrade in version or convention) to eliminate possible problems that would manifest running it as v2.5.6.

Any feedback whatsoever would be appreciated, as I'm a little stuck now after scouring the Grails docs for possible conflicts.

Re: Upgrading from Grails 1.3.9. to Grails 2.5.6.

Darryl, Justin,

It is usually a good idea when doing a large upgrade to start out with a fresh app and start moving pieces of the application into the new app. Its recommended to do this piecemeal if you can and test your components along the way. This can be hard if you have a lot of intertwined components, but hey that's tech debt. Good version control and compare tooling goes a long way here.

With Grails 2.3.x, forked mode was introduced. I'd guess that you have some memory settings to tune in BuildConfig.groovy. Basically the app runs in it's own separate forked JVM without all of the Build-time libraries and dependencies, but you'll need to tune those JVM settings.

I've been working on a similar migration (1.3.x to 2.5.x) and would be happy to share my experience. Here's a ticket that encapsulates some of the post-migration testing I've been trying to do (https://github.com/openboxes/openboxes/issues/94). There are a bunch of migration guides and blog posts on the web (see the links at the top of that ticket above - the list is not comprehensive by any means). Unfortunately, I didn't have a ticket that includes the migration steps, I just followed some of the migration guides and kept notes somewhere. I believe I have documentation somewhere that highlights some of the major issues I resolved during the process. I'll try to publish that to the ticket (or on our wiki when I get a chance).

As far as I remember, the actual migration steps (most of the same steps you've taken and those) only took a few hours, maybe a day or two. I was able to get my project back up and running pretty quickly -- even bragged to my wife that it only took me a few hours to do. Then reality set in. From that point, the long slog has been fixing broken tests, migrating plugins that needed to be upgraded, and a few other really tedious things. Unfortunately, I only get to work on this particular project a few hours per month so it's taking forever, but it sounds like you're pretty close to the end.

1. Startup of the application is extremely slow2. Startup doesn't actually complete as it throws an OutOfMemoryError on heap space

It seems like your memory settings aren't getting picked up? In which environment are you seeing this behavior? Development? Or on a test server? Where are you setting the memory settings? In any case it sounds like 1G should be enough (unless it's doing a lot of object creation during startup) but I would inspect what command-line arguments are actually being used when running the application.

Assuming you're seeing this issue in your development environment on Linux, you can use the following command to see whether your memory config is being used by the grails process.

$ ps -aux | grep grails

If that's not the case, use whatever tools are at your disposal to inspect those arguments. If the memory settings are present, increase the heap memory. If not, try to figure out where Grails is expecting you to set those properties. If you answer the questions above and I can try to help you with that.

So I'm upgrading the web application component of our company product from Grails 1.3.9 to Grails 2.5.6. It's been something we've not had the time to devote to until now, but can no longer afford not to.

So far I've done the following:- updated all dependency libraries and plugins to be Grails 2.x compatible.- modified controllers and services to accommodate new requirements (like changing methods to private/protected where necessary)- updated files installed by 'install-templates'- updated Config.groovy according to a sample 2.5.6. Config.groovy file- modified some Service's to use @Transactional to fix a circular dependency

So far, this has gotten me past a wide range of initial errors encountered. However now I'm stuck with 2 issues:

1. Startup of the application is extremely slow2. Startup doesn't actually complete as it throws an OutOfMemoryError on heap space

I've upped the -Xmx to 1G just to try accommodate that, but to no avail. So my question follows:

What other areas of a v1.3.9 application should I focus on (as in update/upgrade in version or convention) to eliminate possible problems that would manifest running it as v2.5.6.

Any feedback whatsoever would be appreciated, as I'm a little stuck now after scouring the Grails docs for possible conflicts.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].