简体   繁体   中英

How I could upgrade Grails 2.2.4 version to latest or most current version?

I'm working with a Grails application version 2.2.4 and I need a procedure for upgrade to latest version (I hope it can be possible). I have thought as a first step to follow the indications of the official site , but that let me to upgrade to version 3.

I'd like to know if anyone already did it or have experience about that. How long take it?, the process and the main problems.

Many thanks in advance.

I think you need to follow both upgrade instructions. the one for 3.x and the 4.x . start with the 3.x and them move to the 4.x changes. Another approach I think may be better is to start an empty 4.x application and then start moving you code there. also check first that all the plugins that you are you sing have 3+ version.

The effort required to upgrade can change massively depending on multiple factors, including the size of the project, the quality of the original code, were plugins used and if so have they been updated or will the functionality need replacing, were deprecated taglibs used, eg remoteFunction etc. etc.

There is not a great deal of difference between 3.x and 4.x so it makes sense to upgrade to 4.x.

Tackle it in stages from the basis of a new project, attempting to rebuild the project between stages.

  1. Reestablish configuration, you don't have to use application.yaml (the default in 4.x) so can create an application.groovy with the same parameters as per your old project.
  2. Move over domain objects but use a new database URL, compare the schema's between the old db and new db to ensure the database is the same. Unless you don't rely on GORM to recreate/update the schema.
  3. Move over any other source and command objects ensuring the project will build. You may need to modify buildconfig at this stage to bring in dependencies and plugins.
  4. Move over services, ensure all compiles and make sure transactions are behaving as intending.
  5. Move over controllers ensuring any tests run successfully.
  6. Move over the views.
  7. Hopefully if the project is still building at this stage, you can run it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM