Video in progress
How do you plan migrating 40 services from Spring Boot 2.7 to 3.x?
First I remove the blockers (Java 17, javax → jakarta, third-party libraries), then migrate the platform and shared libraries, then move the services in waves ordered by risk and dependencies, using OpenRewrite. The period of running two versions in parallel should be short.
📖 Answer
-
Inventory. For each service: the Java and Boot version, libraries that use
javax.*, the Spring Cloud version, any custom security configuration. This table is the foundation of the whole plan. -
Preparation, while still on 2.7: move to Java 17; get rid of deprecated APIs (in 2.7, things that will be removed in 3.0 produce warnings);
SecurityFilterChainbeans instead ofWebSecurityConfigurerAdapter; update property names withspring-boot-properties-migrator. -
Platform first. Services can't migrate until the internal starters and shared libraries move to
jakarta. -
Automation. An OpenRewrite recipe (
UpgradeSpringBoot_3_x) updates imports, properties and many API changes by itself. What stays manual: the security configuration, query differences in Hibernate 6, and the removal of trailing slash matching. In practice most of the time goes into exactly these three. -
Waves. First 2-3 simple services that still carry real traffic, to gain experience and write a guide. Then team by team. The most complex and critical services go last, with the accumulated experience.
-
Verification: contract tests, canary deploys, comparing error and latency metrics with the old version. Query plans can change in Hibernate 6, so watch for slow queries.
-
Deadline and motivation. OSS support for 2.7 has ended and no security patches are coming out. If you put it to the business in terms of risk, it's easier to get resources.
Sign up to mark studied questions and save your progress.