migrate from grails 3.0.4 to 3.0.6 - grails

What is the simplest way to migrate a Grails app developed in 3.0.4 to 3.0.6?
The grails documentation recommends to create a new app and migrate every component one by one. But there should be a simple way if we are migrating within version 3?
Any help much appreciated

I run a grails create-app to create a fresh install of the new version. I then copy the files from the new version over top of my older v3 version. It's then pretty simple using version control tools to check for changes that need to be merged. The following files will have some changes that need to be merged into my existing project files:
build.gradle
gradle.properties
To be safe I usually also copy over the following, though they are less likely to have changes:
gradle/
gradlew
gradlew.bat
grails-app/conf/application.yml
grails-app/conf/logback.groovy
grails-app/i18n/messages.properties
grails-app/init//Application.groovy
With version control it usually takes less than a few minutes to review and merge back any changes that need to be retained. I find the process fairly simple.

I think you refer to this documentation https://grails.github.io/grails-doc/latest/guide/upgrading.html which is really about grails 2.x to 3.0.x migration.
In the case you're already on 3.0.4 you can just look at the release note of the version to see what is new and if there's any impact. As you will see its a lot of bug fixes and the introduction of the new web profile to create REST specific applications.

Related

Steps to upgrade grails version from 3.0.x to 3.3.x

I am looking to upgrade my grails application(3.0.17) to version 3.3.11. Are there any steps that could be followed to upgrade it completely :
1. Should we create a new app (v3.3.11) from scratch and then move our existing app files to this new app(according to new project structure)?
2. Or we can make the upgrade changes in the existing app itself?
Please check out the official docs:
for upgrading to 3.2.x: https://docs.grails.org/3.2.0/guide/single.html#upgrading31x
for upgrading from 3.2.x to 3.3.x: https://docs.grails.org/3.3.0/guide/single.html#upgrading
Should we create a new app (v3.3.11) from scratch and then move our existing app files to this new app(according to new project
structure)?
Or we can make the upgrade changes in the existing app itself?
Either will work and if done correctly, both approaches will lead to the exact same code in the project after the upgrade. Having been involved in many many Grails upgrades over the last 13 or so years I can say that creating a new app is a big time saver for a number of reasons. Of course the "new" app code gets put in place of the old code and committed to source code control and from looking at source code history you really shouldn't be able to tell if all the files were written by hand or they were created by create-app and then potentially edited.
I hope that makes sense. Best of luck!

Grails upgrade path from 1.3.7 to 3.2.6

I have a Grails application currently running on Grails 1.3.7. I want to upgrade all the way to 3.2.6.
What would be the optimal path to do this? Should I just go straight to 3.2.6 and then try to get dependencies and compilation errors straight? Should I upgrade to 2.0 or 2.5.6 first, then go to 3.2.6? I feel like smaller steps might be easier, but then it seems like it would be harder to find the proper plugin versions to go along with the Grails version. I'm looking for the route that will require the least change and generate the least friction.
What would be the optimal path to do this? Should I just go straight
to 3.2.6 and then try to get dependencies and compilation errors
straight? Should I upgrade to 2.0 or 2.5.6 first, then go to 3.2.6?
At OCI we have done many many of these upgrades since we released 3.0 over 2 years ago. I advocate for skipping the 2.5.x step in almost all cases. Doing the 2.5.x upgrade will require some work that will be undone when you upgrade to 3.2.x and there is no real benefit to paying that additional price. The 2.5.x upgrade will be easier, but doesn't really buy you anything and you will have to take on the 3.x upgrade after that anyway, so just skip the intermediary step unless you have some specific compelling reason to include it (at this point, almost no apps have a valid justification for including that intermediary 2.5.x step).
I hope that helps.
I haven't gone from Grails 1.x to 3.x but have gone from 2.x to 3.x.
I would have thought you'd be better off going straight to 3 but don't expect it to be easy.
I would say make sure all the plugins you currently use have been ported to Grails 3 & if not make plans to either do it yourself or rewrite code to fit.
FWIW I documented my upgrade process here.
Remember there is no config.groovy in Grails 3. All your configuration you need to manage on application.yml. You need to manage your repositories and plugins on build.gradle
Study this document first http://docs.grails.org/3.0.x/guide/upgrading.html
Then, have a look on it Grails Version Update

OpenAM source code failed to build using ant?

We are using this openAM 9.5 RC1 branch source in our project. https://github.com/svn2github/openam.git
In order to fix some bugs, we have to modify existing openAM's amserver library. For this, we have downloaded the source code from above location and tried to compile it offline using ant (as stated in README). But we are not able to compile it anyhow (even after making necessary changes, adding dependencies etc.)
Is there any way to construct required library (amserver.jar) from this source code ?
The OpenAM 9.5.x and 10.0.x versions are rather difficult to build, but from 11.0.0 the build process should be much more simpler since the project has been migrated over to Maven build system.
In any case, the version you are using (Snapshot 9.5.1 RC1) is very much outdated and most likely has several critical issues (not to mention the security issues).
I would strongly advise against putting effort into backporting fixes to that ancient version. Instead you should realize that you are running a more than 4 years old version of a security component, and upgrade your system to a more recent version as soon as possible.

Core Data Versioning, always loading the previous version

I have done lightweight versioning in my project, right now i have two versions and the current version is set to latest one(dataModel 2.xcdatamodel for example). I have followed every steps there in the apple document. But it's crashing every time because the old version is loading(found that after debugging, the new attributes are missing in the entity) after fresh installation.
If i switch back to old version and roll back to current version again then it's running fine. I have deleted the references and added it again but the result is same.
My source code is on git and its very annoying to do that extra effort every time. Please help me to solve this problem.
thanks :)
If you are 100% sure that the new version is loaded, it means that you created the new version, started the app, applied changes to the model, started the app again. To eliminate the possibility of it, just create the 3rd version based on the 2nd version and make it current active. Also make sure you have the automated lightweight migration implemented as per apple manual here
https://developer.apple.com/Library/ios/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/vmLightweightMigration.html
I am not sure, i guess it is a git/svn problem. We had to work with different versions of Xcode from the very beginning of the project. Whenever we committed to the git, the git found a miss match of Xcode versions(for say i am working with Xcode 5.1 and my team mate working with Xcode 5.0.1, the project was initialised with Xcode 4.1) and set the current core data version to the very older one that is dataModel 1.xcdatamodel in my case. That's why the project was running fine in my side but when my team mate pulled my code from the git and tried to run in his side it crashed everytime because the version was set to older one by the git.
I got this from here. After following the instructions the problem is solved for now.
Thank you all. If you have any better solution please share.

Upgrading from Grails 1.0.3 to 1.3.5

I've just inherited an application written in Grails (version 1.0.3) and would like to upgrade it to the newest release (version 1.3.5).
I can't seem to find a reference that enumerates the differences between the two versions. I know there is the "grails upgrade" command - but is this the best option given the large differences in versions.
I have a similar question that I asked today as well for upgrading the version of Groovy, and the sntactical differences to be aware of (between version 1.3.5 and 1.7.5) - but I thought it may be best to separate the two questions to focus on each.
Many thanks,
~Aki
Things have changed quite a bit since 1.0.3, and unfortunately grails upgrade isn't going to do much for you.
Two significant changes that come to mind are that there was a bug in 1.0.3 and previous where 1-many and many-to-many collections (hasMany/belongsTo) were supposed to be lazy-loaded but weren't. This was fixed in 1.0.4 and several users found that they were relying on the behavior and saw issues. Most people didn't, and just saw a significant performance boost. So watch out for lazy loading exceptions.
Another thing that changed is that plugins are no longer in the root of the project in the 'plugins' folder but are now stored under your $HOME/.grails folder. If you've checked the plugins into source control (and especially if you've made any changes) then you can revert to 1.0.x behavior by adding a property to BuildConfig.groovy (a new file that was introduced in 1.1):
grails.project.plugins.dir = 'plugins'
I described my process for upgrading plugins and apps here: How to install Grails plugin from source code? - it's about a plugin project but the same goes for app upgrades.
The log4j configuration changed from one that's properties-based to a DSL. This means that if you leep your config settings from Config.groovy the log4j behavior will be the default, so you'll need to convert that.
Another change that isn't required but should be considered is that Ivy jar file resolution from Maven repos is now preferred over putting jar files in the lib directory. You can still put them in the lib dir, but it's more DRY to have Ivy download them once.
You'll probably also find that some of the plugins you have don't work in 1.3, so there might be some migration work there.
There are two recent books that cover Grails 1.2/1.3, "Grails: A Quick-Start Guide": http://www.amazon.com/dp/1934356468/ and "Getting Started with Grails, 2nd ed": http://www.infoq.com/minibooks/grails-getting-started - you should probably check those out since they're the most current Grails books.
Overall it shouldn't be that bad, as long as you don't try to upgrade in-place. Use the approach I described in the other post I referenced, i.e. create empty apps and diff files to see what changed (basically a 3-way diff).
The newest release is 1.3.6 (as of Dec 15). You can get a list of changes from the Release Notes of each release. Also, the upgrading from previous versions link the documentation is a good source of changes.

Resources