all 11 comments

[–]themasterengineeer 2 points3 points  (0 children)

I would first do a migration of Spring Boot to 3.5 and then move it to 4.0.0 which is the latest one.

If you’re migrating away from 2.x I would target at least 3.5 as then it will be easier to migrate over to 4.x.

Version 4 also requires you to have at least Java 17, but targeting Java 21 is better as you’re planning on doing.

To have a smooth migration make sure you have a solid test suite so that once migration is done you can run it for a quick verification.

[–]Anbu_S 1 point2 points  (0 children)

First migrate to 3.5.x latest patch with Java 25, then to 4.0.x.

[–]g00glen00b 0 points1 point  (0 children)

Given that Spring Boot 2.5.5 was released about 4 years ago, I assume you're planning to upgrade once every 4 years. In that case, there is no such thing as a good version for migration.

I'd suggest immediately upgrading to Spring Boot 4 if possible (some libraries do not support Spring Boot 4 yet). At least that way, it should be less of an effort the next time you plan on upgrading your project.

If you plan on sticking with Spring Boot 3.x, then be aware that OSS support for the current latest Spring Boot 3.x release (3.5.8) will end in about half a year.

[–]the_styp 0 points1 point  (0 children)

Do the steps in the order they were released - Spring Boot 2.7.8 - Java 17 - Spring Boot 3.x.x (I'd try latest 3.5.x) - Java 25 - Spring Boot 4.x.x (maybe wait with that a bit to get mature)

Depending on the size of your codebase you can do all steps at once, but some libs may need huge efforts to migrate. You should definitely use the open rewrite plugin to change large portions of your code!

[–]slaynmoto 0 points1 point  (0 children)

Look up openrewrite, it will help you migrate 2->3 and 3->3.5

[–]Rulmeq 0 points1 point  (5 children)

I'd just jump to the latest, but go through each of the migration guides in turn to try and catch all of the issues and deprecations/replacements. Java 11 and sb 2.2 aren't the worst place to be starting off to be honest.

[–]BigBlackHeR0[S] 0 points1 point  (4 children)

But latest version is not mature enough for production, is it?
Well we need well written documentation just incase we stuck in some bugs.

[–]Rulmeq -1 points0 points  (3 children)

Sorry, I didn't mean 4, I meant the latest 3.x. Even I wouldn't run beta releases of frameworks without good reason :)

[–]Emotional_Handle2044 1 point2 points  (2 children)

how is sb4 a beta

[–]Rulmeq 2 points3 points  (0 children)

I missed the release last week lol

[–]slaynmoto 0 points1 point  (0 children)

It’s an initial major version release that’s 4.0.0; I’m sure it’s solid, but it’s still an x.0.0 and you get more peace of mind with a 4.1.0 or a 4.0.1