Scrivio Interview library
CodingFoundations6 min read · updated 12 November 2026

What is spring-boot-properties-migrator and how do you use it during an upgrade?

spring-boot-properties-migrator is a Spring Boot dependency that analyses the application's environment at startup and reports configuration properties that were renamed or removed in the new version. For renamed properties it also maps the old key to the new one at runtime, so the application keeps working, and it logs exactly what to change. We add it as a runtime dependency during the upgrade only, fix the configuration, and remove it.

Why this question is asked

Every Boot release renames or removes a few configuration properties, and a property with an old name is not an error by default. Boot simply ignores it, and the feature falls back to its default value. That is how a service ends up connecting to Redis on localhost after an upgrade, or losing its metrics export, with no error at startup. Interviewers ask about the migrator because it is the standard tool for catching exactly this class of problem. In this answer, we will see why renamed properties fail silently, add the migrator, read its report, understand how it works, and then remove it again.

1Why Renamed Properties Fail Silently

Spring Boot binds properties from application.yml, environment variables and other sources into configuration classes annotated with @ConfigurationProperties. A property that matches no configuration class is just an unused entry in the environment. Boot does not complain about unused keys, because the environment also holds many keys that belong to other libraries or to our own code.

So when Boot 3.0 renamed spring.redis.host to spring.data.redis.host, an application that still set spring.redis.host started normally, but the Redis configuration never saw the value and used its default, localhost. The same happened to many metrics export properties. The application only failed later, when it tried to connect.

YAML
# application.yml written for Boot 2.7
spring:
redis:
host: cache.prod.internal # Boot 3: ignored, the new key is spring.data.redis.host
# Boot 3 at runtime
# Unable to connect to Redis: localhost:6379 (the default, not our host)

2Adding the Migrator

The migrator is a normal dependency managed by the Boot BOM, so we add it without a version. It must be on the runtime classpath, because it does its work when the application starts; nothing in our code calls it.

XML
<!-- Maven -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-properties-migrator</artifactId>
<scope>runtime</scope>
</dependency>
// Gradle
runtimeOnly("org.springframework.boot:spring-boot-properties-migrator")

Notice the runtime scope. The migrator is not something to compile against, and the scope makes it clear that it is a temporary helper for the upgrade, not part of the application.

3Reading the Report

When the application starts, the migrator prints a report after the context is ready, or when startup fails. It has two parts. The first lists keys that have been renamed, with their source and replacement. The second lists keys that are no longer supported at all, with a reason when one exists.

Java
WARN PropertiesMigrationListener :
The use of configuration keys that have been renamed was found in the environment:
Property source 'Config resource 'class path resource [application.yml]'':
Key: spring.redis.host
Line: 4
Replacement: spring.data.redis.host
Each configuration key has been temporarily mapped to its replacement for your convenience.
To silence this warning, please update your configuration to use the new keys.
ERROR PropertiesMigrationListener :
The use of configuration keys that are no longer supported was found in the environment:
Key: some.removed.property
Reason: none

So for renamed keys the application now works, because the migrator has copied the value to the new key, and we know the file and line to change. For removed keys there is nothing to map; we must read the release notes and decide what replaces the feature. The exact wording of the log may differ between versions, but the two groups are always there.

4How It Works Inside

Every Boot jar ships configuration metadata, a JSON file that describes each property, its type and default, and, for deprecated ones, the deprecation level and the replacement key. The migrator reads this metadata from the classpath, which means it knows about the properties of the Boot version we are upgrading to.

Early in startup, before beans are created, it walks through every property source in the environment and looks for keys the metadata marks as deprecated. For each renamed key it adds a new property source that holds the value under the replacement name, so binding finds it. Then it records each finding and prints the report.

Step throughWhat the migrator does at startup
  1. Load configuration metadatafrom every jar on the classpath
  2. Walk all property sourcesfiles, environment variables, imports
  3. Key marked deprecated?
    YesCheck for a replacementNoLeave it alone
  4. Has a replacement key?
    YesCopy the value under the new keyNoRecord it as unsupported
  5. Print the reportrenamed and unsupported keys with their sources

5 steps in order. Play them, or step through them one at a time.

Because it walks the real environment, it sees every source that is loaded at startup, not just application.yml.

5Removing It After the Upgrade

The migrator is meant to be temporary. Its runtime mapping hides the problem, so leaving it in means the configuration stays wrong and the next upgrade inherits it. Startup also does a little extra work. Once the report is empty in every environment, we remove the dependency.

There is a catch worth knowing: the migrator only knows properties that have metadata. It reports Boot's own properties and those of libraries that publish metadata, but not keys our own code reads with @Value, and not properties of a profile or environment that was not active when we ran it. So we run it once in each environment and check our own keys separately.

YAML
# After fixing application.yml
spring:
data:
redis:
host: cache.prod.internal # Boot 3 key
# Startup log now shows no PropertiesMigrationListener warnings,
# so we remove spring-boot-properties-migrator from the build.

6Follow-up questions

Should the migrator ever go to production?

Briefly, if that is the only way to see production configuration, for example when some properties exist only there. Run it in a canary, collect the report and remove it. It should never stay as a permanent dependency, because its mapping hides configuration that needs to be fixed.

Does the migrator fix my files?

No. It changes nothing on disk. It only maps the values in memory for the current run and tells us what to change. We edit application.yml, environment variables or the config repository ourselves, or use an OpenRewrite recipe for the files in the repository.

Does it help with my own @ConfigurationProperties?

Only if our own classes publish deprecation metadata, for example with @DeprecatedConfigurationProperty on a getter and the configuration processor generating metadata. Then the migrator treats our renamed keys like Boot's own.

7Conclusion

In this answer, we saw that renamed properties fail silently because Boot ignores unknown keys. spring-boot-properties-migrator, added as a runtime dependency during the upgrade, reads the new version's metadata, scans every property source at startup, maps renamed keys to their replacements and reports both renamed and unsupported keys. We fix the configuration in every environment and then remove it.

What to say in the interviewAbout 70 seconds aloud

Open with

spring-boot-properties-migrator is a helper for upgrades. The problem it solves is that Boot ignores unknown property keys, so when a key is renamed, for example spring.redis.host to spring.data.redis.host in Boot 3, the old key is silently ignored and the feature falls back to its default.

Then, if they want more

I add the migrator as a runtime dependency, with no version because the BOM manages it.

At startup it reads the configuration metadata of the new Boot version, walks every property source in the environment, and for each renamed key it copies the value under the new key, so the application keeps working, and logs the source, the line and the replacement. Keys that were removed with no replacement are reported separately as unsupported.

Then I fix the configuration in every place it lives and run the application again until the report is empty. I run it in each environment, because it only sees the sources and profiles that are actually loaded, and I check my own @Value keys separately, since it only knows properties that have metadata.

Finally I remove the dependency, because its runtime mapping would otherwise hide wrong configuration.

About this answer

Last updated
12 November 2026
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 "What is spring-boot-properties-migrator and how do you use it during an upgrade?": https://scrivio-interview-library.netlify.app/spring-boot/boot-migrations/26b04d4917/