Quick revision
The short answer
Go in small, separately released steps, so that each step has one kind of change. First upgrade from 2.5 to 2.7 through 2.6 and remove every deprecation warning. Then move to Java 17 while still on 2.7. Then upgrade third-party libraries to versions with Jakarta support. Only then switch to Boot 3.x, using OpenRewrite recipes to do the mechanical work, fix the remaining compile errors and tests, run with the properties migrator, compare behaviour in staging, and finally remove the migrator.
What to remember
In this answer, we planned the upgrade of a large service from Boot 2.5 to 3.3 in separately released steps. We upgraded through 2.6 to 2.7 and removed deprecations, moved to Java 17 on 2.7, upgraded libraries to Jakarta-ready versions, switched to Boot 3 with OpenRewrite recipes and fixed what remained, then used the properties migrator and a staging comparison before removing the migrator. Each step has one kind of change, so every failure has a clear cause and the service stays releasable throughout.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Go in small, separately released steps, so that each step has one kind of change. First upgrade from 2.5 to 2.7 through 2.6 and remove every deprecation warning. Then move to Java 17 while still on 2.7. Then upgrade third-party libraries to versions with Jakarta support. Only then switch to Boot 3.x, using OpenRewrite recipes to do the mechanical work, fix the remaining compile errors and tests, run with the properties migrator, compare behaviour in staging, and finally remove the migrator.
Why this question is asked
Jumping straight from Boot 2.5 to 3.3 changes the Java version, the Spring generation, the enterprise package names, the security configuration and dozens of library versions at the same time. When the large service then fails in a hundred ways, nobody can tell which change caused which failure. Interviewers ask for an order because a good plan isolates the changes, keeps the service releasable after each step, and uses tools for the mechanical work. In this answer, we will walk through the steps in order and explain why each comes where it does, including the specific problems each step usually brings.
1Why the Order Matters
A migration is safest when every step is small, is released to production on its own, and has one obvious cause for any failure. If the Java upgrade and the Boot upgrade happen together and a test fails, we have to investigate both. If they happen a week apart, the cause is clear. Releasing after each step also means we can stop at any point with a working service, which matters for a large service that keeps getting new features during the migration.
So the plan below has five stages, and each one ends with the full test suite green and a production release.
- 2.5 -> 2.6 -> 2.7fix each minor's changes, remove deprecations
- Java 17 on Boot 2.7build, CI and runtime images
- Jakarta-ready librarieson 2.7, before the switch
- Switch to Boot 3.x with OpenRewritejavax -> jakarta, security, properties
- Fix compile errors and teststhen step 3.0 -> 3.3
- Properties migrator + staging comparisonthen remove the migrator
6 steps in order. Play them, or step through them one at a time.
Each stage is released on its own, so any failure has one cause.
2Upgrade to 2.7 and Remove Deprecation Warnings
We go to 2.6 first and then 2.7, reading each release's notes. Boot 2.6 brings two changes that often break large services: circular references between beans are prohibited by default, and Spring MVC's default path matching switches to PathPatternParser. The quick fix for circular references, spring.main.allow-circular-references=true, should be temporary; the real fix is to break the cycle, because Boot 3 keeps the prohibition.
On 2.7 we then remove every deprecation warning, in our code and in configuration. The reason is a simple Boot rule: APIs deprecated in 2.x were removed in 3.0. Code that compiles on 2.7 without deprecation warnings has already moved off most removed APIs, so the later switch has far fewer surprises. This is also when we rewrite WebSecurityConfigurerAdapter into SecurityFilterChain beans, which 2.7 supports.
3Move to Java 17 While Still on 2.7
Boot 2.7 supports Java 17, so we can change the Java version without changing Spring at all. We update the compiler release setting, the CI build image and the runtime base image. Typical problems at this step are libraries that use reflection into JDK internals, which Java 17 blocks by default and which show up as InaccessibleObjectException, old versions of Lombok, Mockito or bytecode libraries that do not support the new class file version, and build plugins that need updating.
Doing this separately has a real benefit: if latency or memory changes after the release, we know it is the JVM, not Spring. With Java 17 running in production, the Boot 3 switch has one less variable.
4Upgrade Libraries to Jakarta-Ready Versions
Boot 3 uses Jakarta EE, so every library that touches servlet, JPA, validation or other enterprise APIs needs a version built for jakarta packages. Many libraries publish versions that work with both Boot 2.7 and Jakarta, or move to a Jakarta version at a known release, and we take as many of those upgrades as possible while still on 2.7. For the rest we plan the swap: Springfox to springdoc-openapi 2, older Ehcache artifacts to their Jakarta variants, Spring Cloud to a release train that supports Boot 3, and internal libraries to new major versions.
We make a short list, per library, of the current version, the Jakarta-compatible version and whether it can be upgraded before the switch. That list is the main risk register for the next step; a library with no Jakarta version is a blocker that must be replaced first.
5Switch to Boot 3 With OpenRewrite
Now we change the Boot version. OpenRewrite, a tool that applies automated refactoring recipes to code and build files, has Spring Boot migration recipes that do most of the mechanical work: change the parent version, rename javax imports to jakarta, update the security configuration, rename properties and update known dependencies. We run the recipe for our target version, review the diff, then fix what the recipe could not: compile errors in unusual code, failing tests and libraries outside the recipe's knowledge.
For a large service, some teams prefer to switch to 3.0 first and then move 3.0 -> 3.1 -> 3.2 -> 3.3, reading each version's release notes. One known 3.2 trap is that Spring Framework 6.1 no longer infers parameter names from debug information, so the compiler must use the -parameters flag; the Boot parent sets it, but custom compiler configurations may not. Note also that 3.3 is already past its open-source support period, so check the support calendar and consider targeting a currently supported line instead.
6Properties Migrator, Staging Comparison, Then Remove It
Renamed properties do not fail compilation; old names are silently ignored. So for the first releases on Boot 3, we add spring-boot-properties-migrator as a runtime dependency. At start-up it logs every renamed or removed property it finds and maps renamed ones to their new names temporarily, so the service behaves as before while we fix the files.
Then we compare behaviour in staging, not just test results. We run the old and new versions side by side, replay a sample of traffic or run the same end-to-end suite against both, and compare responses, error rates, latency and logs. This catches the quiet changes: trailing slash URLs that now return 404, JSON date formats, Hibernate query differences and tracing sampling. When the migrator log is empty and staging matches, we remove the migrator and release again.
7Follow-up questions
Why not skip 2.6 and 2.7 and use OpenRewrite to go straight to 3.3?
The recipes can chain through the versions, but they only handle what they know. The behaviour changes of 2.6, like circular references and path matching, and all deprecation removals would land in the same release as Jakarta and Spring 6. Taking the 2.x steps first keeps each release small and each failure understandable.
How do you keep feature work going during the migration?
Each stage is merged and released quickly, so the main branch never stays on a long-lived migration branch. The Boot 3 switch is the only large change; we prepare it with a recipe run on a branch, fix tests there for a few days, rebase onto main and merge it with a short freeze, rather than keeping it open for weeks.
What would you check in production after the switch?
Error rates by endpoint, especially 404s that could be trailing slash calls, latency and memory compared with the previous release, start-up logs for migrator warnings, and whether traces still appear in the tracing tool, since sampling now defaults to 10 percent.
8Conclusion
In this answer, we planned the upgrade of a large service from Boot 2.5 to 3.3 in separately released steps. We upgraded through 2.6 to 2.7 and removed deprecations, moved to Java 17 on 2.7, upgraded libraries to Jakarta-ready versions, switched to Boot 3 with OpenRewrite recipes and fixed what remained, then used the properties migrator and a staging comparison before removing the migrator. Each step has one kind of change, so every failure has a clear cause and the service stays releasable throughout.
Open with
I would keep every step small and released on its own, so each failure has one cause. First, 2.5 to 2.6 to 2.7. On 2.6 the usual breakages are circular bean references, which are now prohibited, and the switch to PathPatternParser; I fix cycles properly because Boot 3 keeps the rule.
Then, if they want more
On 2.7 I remove every deprecation warning, since what was deprecated in 2.x is removed in 3.0, and I rewrite WebSecurityConfigurerAdapter into SecurityFilterChain beans, which 2.7 already supports. Second, Java 17 while still on 2.7: build, CI and runtime images, plus libraries like Lombok or Mockito that need newer versions; if performance changes, I know it is the JVM.
Third, libraries: I list every dependency that touches servlet, JPA or validation, and upgrade or replace them with Jakarta-ready versions, Springfox to springdoc, Spring Cloud to a Boot 3 train. Fourth, the switch itself with the OpenRewrite UpgradeSpringBoot recipe, which handles the parent version, javax to jakarta and property renames; then I fix compile errors and tests.
Last, I run with the properties migrator, compare old and new side by side in staging for 404s, date formats and query differences, and remove the migrator once its log is clean. I would also point out that 3.3 is already out of open-source support, so I would target a currently supported version.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Java 17, Spring Framework 6
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Boot reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Plan the upgrade of one large service from Boot 2.5 to 3.3. In which order would you do...": https://scrivio-interview-library.netlify.app/spring-boot/boot-migrations/05fbad5b3c/