19 March 2015

Update a grails project from version 2.3.8 to version 2.4.4

At first I changed the version of the application to 2.4.4.
> grails set-grails-version 2.4.4

I also created a new appliction with grails 2.4.4. From this application I took the BuildConfig.groovy and copied the content into to the BuildConfig.groovy of the application I wanted to update. Then I added the changes to the BuildConfig which  are necessary for the application.

In the datasource of the application I had to change my current setting for hibernate which pointed default to Hibernate 3 so it will point to hibernate 4.
So I commented:    
//cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
And uncommented:
cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
I copied the applicationContext.xml from the web-app/WEB-INF folder of the new application to the same file of the application I wanted to update. 

Then I removed the target folder and tried to run the application by running
> grails run-app.

For one of my applications I got an error after starting. I fixed that application by setting the Hibernate version back from Hibernate 4 to Hibernate 3. 

No comments:

Post a Comment