Upgrading Grails from 3.1.9 to 5.3.6: A Personal Journey
Over the past few months, I’ve enjoyed about 300 hours of coding, even though they were scattered between meetings, team changes, production issues, and grocery runs. I still like working on old stuff, so these hours were spent on upgrading a legacy microservice through multiple Grails versions: 3.1.9 → 3.3.6 → 4.1.4 → 5.3.6. It’s been an interesting ride since I haven’t had much hands-on experience with Groovy and Grails before. It feels like stepping back in time to trace Grails’ footprint, especially now that its founder has shifted focus to the Micronaut framework.
A Challenging Upgrade Process
The upgrade was quite a bit of work, so I naturally turned to Copilot. It was interesting to see that Copilot struggled with the upgrades from versions 3 to 4, only to suddenly perform much better during the 4 to 5 upgrade. In the end, I spent about 200 hours cleaning up and upgrading 3.1.x to 3.3.6, 150 hours upgrading 3.3.6 to 4.1.4, and just a week (with one bug) to complete the upgrade to 5.
Lessons Learned and Tips
I compiled upgrade instructions from scattered online sources, enriched them with my own notes, resolved issues, and added tips. Along the way, I realized that:
- Grails 3.3.6 has a more modern Groovy version (2.5.4) compared to Grails 3.1.9 (2.4.8), which made some changes necessary.
- Grails 4.1.4 introduced a new way of handling dependencies, which required some adjustments.
- Grails 5.3.6 has a new web server, which needed to be configured.
Conclusion
This experience with upgrading Grails versions has been a valuable learning experience. I hope that sharing my notes and tips will help others who are facing similar challenges. The upgrade process was time-consuming, but the end result was worth it. If you’re working with Grails, I encourage you to take the time to upgrade to the latest version to benefit from new features and improvements.
FAQs
Q: What are the key differences between Grails 3.1.9 and 5.3.6?
A: Grails 3.1.9 has an older Groovy version (2.4.8), while Grails 5.3.6 has a newer Groovy version (2.5.4). Additionally, Grails 5.3.6 has a new web server and improved dependency management.
Q: How long did the upgrade process take?
A: The upgrade process took about 300 hours, spread across three major upgrades: 3.1.9 to 3.3.6 (200 hours), 3.3.6 to 4.1.4 (150 hours), and 4.1.4 to 5.3.6 (1 week with one bug).
Q: What is Copilot, and how did it help with the upgrade process?
A: Copilot is a tool that helps with the upgrade process. It struggled with the upgrades from versions 3 to 4, but performed much better during the 4 to 5 upgrade. It was an interesting experience to see how Copilot handled the different versions.

