spierepf
spierepf

Reputation: 2924

What is the correct procedure for upgrading a Grails project from version a.b.c to x.y.z

I have been developing Grails apps for the past five years or so, and I have yet to find a simple consistent procedure for upgrading a project between Grails versions. Typically, I wind up starting the project from scratch, painstakingly copying code from the old project into a new project, bit by bit. Tweaking along the way to get the tests to pass.

There just seems to be too many balls to juggle, from Grails versions, to groovy versions, to STS/GGTS versions. They all seem to be backwardly incompatible.

Upvotes: 4

Views: 8468

Answers (4)

Mohammed Shaheen MK
Mohammed Shaheen MK

Reputation: 1219

You can upgrade grails version with 5 steps

  1. Project -> Clean
  2. application.properties -> Change app.grails.version = (New version)
  3. Your project -> Properties -> Grails -> Change grails installation to new grails version.
  4. Your project -> Grails tools -> Refresh Dependencies
  5. Run your project

I think this may be help you

Upvotes: 1

aboyko
aboyko

Reputation: 1557

If I use GGTS I do the following:

  1. Just in case install latest Groovy compiler (2.3.x) from the STS/GGTS update site (pick Groovy Eclipse). Then select the select.
  2. Go to Preferences Groovy -> Grails and add newer version Grails runtime. Browse to it and then once added check-mark it.
  3. Right-click on the Grails project you'd like to upgrade. Context menu pops up. Click on Grails Tools -> Grails Command Wizard...
  4. Select the "upgrade" command from the list and click Finish. Follow the prompts in the Console view to upgrade the project.
  5. Now set the appropriate for the version of Grails Groovy Compiler version via the preferences Groovy -> Compiler and restart Eclipse
  6. Fix the compiler version for the Grails project if necessary after the restart.

Upvotes: -1

Marcin Świerczyński
Marcin Świerczyński

Reputation: 2312

I actually work with Grails for a few years too and never had to that this way.

What I do is:

  1. Install the new version of Grails. I use GVM for that and I highly recommend it, but it depends on your platform of choice.
  2. Read release notes for this version and apply them. It's very important step. It often includes some Grails "built-in" plugins upgrades and so on.
  3. Bump up the version number using grails set-version.
  4. Update IDE settings. I use IntelliJ and it runs smoothly most of the time.
  5. Do grails clean/grails clean-all. Remove target.
  6. Run all tests.
  7. Do some "smoke tests" of the application. Test the most important happy paths.

Upvotes: 6

wwwclaes
wwwclaes

Reputation: 1152

I'm afraid you might already be doing it right, but if you don't own a copy of "Programming Grails" by Burt Beckwith I suggest you buy it. There's a chapter on "Upgrading Applications and Plugins" that might help you tune your approach.

Upvotes: 1

Related Questions