Grails - Upgrade and downgrade version of the project - grails

I made an example project in grails 2.3.8. How to upgrade to the newest version? No way to downgrade from version too?

It really depends on the differences between the versions. In a lot of cases you will get away with simply editing the version number in the application.properties file at the top of the project. There used to be a grails upgrade command which attempted to do some of the work for you but that approach proved to be problematic for a number of reasons so it was removed in Grails 2.4. The normal upgrade procedure now is to edit the version number, which can be done using the grails set-version command (which just updates application.properties, see http://grails.org/doc/latest/ref/Command%20Line/set-grails-version.html) and then reading release notes for any other particulars related to that release. Often the release notes suggest updating some specific plugins to specific version numbers for compatibility.
Downgrading generally could be done with the same approach. Depending on what is in your application you might run into problems going backwards in versions.
I hope that helps.

Related

Can i upgrade directly from Grails 2.x to Grails 4.x bypassing all median levels

I am having an application build on grails 2.2.4. I need to update it to grails 4.0.8 Can i upgrade directly. As i checked from various sources, i need to jump first from 2.2.4 to 3.x then thereafter 3.x to 4.x. Please suggest me optimum way to do this upgrade.
Similar to other question about Grails upgrades
Major version upgrades in Grails are rarely trivial. I'd suggest starting a new app in the target version, and migrating classes/functionalities.
In Grails framework, the effort required to update your application depends on multiple factors, such as:
The standard practices. For instance, the persistence stuff in the Grails services instead of controller or domains itself.
The underline plugins your application depends on. You would need to update to the latest version of the plugin, or in some case find an alternative approaches as the plugin may longer be maintained, or there maybe better ways of doing it. For instance, we had some custom plugin for multi-tenancy back when I started with Grails, But now, GORM has great support for multi-tenancy.
I personally think you should directly jump from Grails 2 to Grails 4 by creating a new application, and then move your source code. But, first you need to identify all the variables such as plugins or libraries.

Grails upgrade from 1.3 to 2.4

I have a legacy grails app running on 1.3 on Java 6 with tomcat 6.
We need to upgrade to java 8 on tomcat 8.
Is it possible to upgrade grails version from 1.3 to 2.4.5.
Lot of compilation issues and some of the holder classes are missing.
Please suggest.
The easiest way we've found to upgrade between incompatible versions of Grails is to create a new application in the new version, and migrate the services/controllers/src directories into the new application.
You will need to keep in mind various changes (like the Holders classes you mentioned, which are now part of Holders in grails.util.Holders, iirc). Also, you'll probably need to upgrade any plugins you use to newer 2.4.x-compatible versions as well (specifically spring-security, etc.)
It's not an easy task, but it can be done. We've migrated from 1.x to 2.x before, and from 2.2 to 2.4, and we're currently migrating to 3.x. BTW, since you're migrating, perhaps moving to 3.x would be a better move?
Good luck!

Grails upgrade from 1.2.2 to version that supports multiple datasources

I have several applications created with grails 1.2.2. I need to modify one of these applications to work with multiple datasources. It seems that my best option is to upgrade to a new version of grails. I'm worried that trying to go straight to grails 3 will cause major issues, but am not sure which versions to step through if I'm going to upgrade gradually. Any advice? I apologize for this being so open ended.
The first info about support for multiple databases in official docs exists in version 2.0.0:
http://docs.grails.org/2.0.0/guide/conf.html#multipleDatasources
Check out this guide for upgrade:
http://docs.grails.org/2.0.0/guide/gettingStarted.html#upgradingFromPreviousVersionsOfGrails

Why upgrade an application to latest version of Rails?

I'm just trying to understand the factors that are considered to decide that an application written in a lower version needs to be upgraded.
I would like to think it comes down to these factors:
The Rails team is pretty active and they remedy Rails core security issues as soon as they come across one. It would be nice to have your Rails version always updated which means your have all the security issues of the past addressed as well as open to further updates if they come along. You would not want an older version of Rails get in the way of a security update.
There are always performance improvements in almost every new version of Rails and optimization is an area to work in for Rails apps. You should take advantage of them by keeping your Rails version updated.
Its not only the Rails version, the underlying Ruby version also receives updates and performance improvements. The updated version of Rails makes use of these.
There is also the gem dependency issue. Gems also receive updates and security patches and at times, newer versions of these gems are not compatible with an older version of Rails.
It is easier to upgrade a Rails application to its next version than to its next|next|next|next version. Blog posts and migration guides are always online but if you are coming from a very very old Rails version, they will become very hard to follow.
Newer versions of Rails provide functionality that is not available in the older versions of Rails. It is always nice to have this functionality at your disposal. You never know you may need it in your project.

Grails version differences

I am finishing reading a book that I only now realized was written for Grails 1.1.1! We are on version 1.3.7 which seems light years away in Programming language terms.
Could anyone give a distilled comparison between Grails versions? What new features should I be aware that were added after 1.1.1?
Each version ships with a set of Release Notes that outline the major changes. All of the major releases can be found on the Grails archive download page.
Reading through the latest documentation will probably help, too.

Resources