Quick revision
The short answer
The properties migrator inspects the real environment at runtime, so it sees every property source loaded at startup, including mounted ConfigMaps, environment variables and the config server. So I would run each environment once with the migrator in staging and collect its warnings, also search the application repositories and the config repositories for old keys, update every source, and only then remove the migrator.
What to remember
In this answer, we saw that ConfigMaps, environment variables and config server files all become property sources in one Environment, so the properties migrator reports old keys from all of them. Because it only sees what a run loads, we run every staging environment with it, search the application, config and Helm repositories for both spellings of each old key, add new keys before removing old ones in shared files, and remove the migrator only when everything is clean.
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.
The properties migrator inspects the real environment at runtime, so it sees every property source loaded at startup, including mounted ConfigMaps, environment variables and the config server. So I would run each environment once with the migrator in staging and collect its warnings, also search the application repositories and the config repositories for old keys, update every source, and only then remove the migrator.
Why this question is asked
In a real platform, configuration is rarely in one file. A service reads defaults from application.yml in its jar, environment-specific values from Kubernetes ConfigMaps, and shared or secret values from a config server. When a Boot upgrade renames properties, the old key can hide in any of those places, and a missed one only shows up when that environment misbehaves. Interviewers ask this scenario to see whether we understand where Boot's environment comes from and how to make a check complete. In this answer, we will recap how the sources combine, see why the migrator sees them all, plan the staging runs, add a search of the repositories for what runtime cannot see, and finish with the order of changes.
1A Quick Recap of Where Properties Come From
Spring Boot builds one Environment, an ordered list of property sources, when the application starts. Our application.yml is one source. A ConfigMap is usually either mounted as a file, imported with spring.config.import or found as an application.yml in a mounted directory, or injected as environment variables such as SPRING_DATA_REDIS_HOST. A config server, such as Spring Cloud Config, is imported with spring.config.import=configserver: and adds one source per matching file in its repository.
Notice that all of these end up in the same Environment, in a defined order of precedence. Once they are there, Boot does not care where a value came from. That is what makes the migrator useful in this scenario.
- Environment variablesfrom the pod spec or a ConfigMap
- Mounted ConfigMap filesimported with
spring.config.import - Config server
application.ymlandorders-prod.ymlfrom the config repo - application.yml in the jardefaults written by the team
4 layers, from the top down. Step through them one at a time.
Higher sources override lower ones; the migrator checks every one of them.
2Why the Migrator Sees All Sources
The properties migrator runs early in startup, after the Environment has been prepared and before beans are created. By that point Boot has already processed spring.config.import, contacted the config server and read the mounted files and environment variables. The migrator walks every property source in the Environment and compares each key with the deprecation metadata of the new Boot version, so it reports old keys whatever source they came from, with the source's name in the report.
But there is a catch: it only sees what this particular run loaded. A profile that was not active, a config server file for another application or label, or a ConfigMap for another cluster is not in the Environment, so the migrator cannot report it. That is why one run is not enough.
3Running Each Environment in Staging
I would deploy the upgraded service with the migrator to every staging environment that mirrors a production configuration: each region, each tenant setup and each active profile combination. Each deployment points at the same config server labels and the same ConfigMaps as its production counterpart. Then I collect the warnings from the startup logs, for example with a log query for PropertiesMigrationListener, and build one list per service of key, source and replacement.
Environment variables need a quick check. They arrive in upper case with underscores, and Boot maps them to property names through relaxed binding. The migrator generally recognises them through that mapping, but I would confirm it in our version by setting one known old key as an environment variable and checking that it appears in the report.
4Searching the Repositories Too
For what runtime cannot see, I would search the source. The list of renamed keys is available from Boot's own configuration metadata and the migration guide. A small script can turn it into a search over every application repository, the config server repository with all its files and branches, and the Kubernetes manifests or Helm charts that define ConfigMaps.
Notice the second hit. The disaster recovery configuration is rarely deployed, so no staging run would have loaded it. The search also needs the environment variable spelling of each key, which is the key in upper case with dots replaced by underscores, so the script should search for both forms.
5Updating Every Source Before Removing the Migrator
The order of changes matters, because several services may share the same config server files. I would first add the new keys alongside the old ones in shared sources, which is harmless for services still on the old Boot version since they ignore keys they do not know. Then upgrade the services. Then remove the old keys once every consumer is on the new version.
Finally, run the staging environments again. When the migrator reports nothing in any environment and the repository search finds no old keys, we remove the migrator and release. A small startup test that asserts important bound values, such as the Redis host for each profile, helps catch anything that slips through.
- Upgrade with the migrator in stagingone run per environment and profile
- Collect warnings from startup logskey, source and replacement
- Search app, config and Helm reposboth dotted and environment spellings
- Add new keys beside old ones in shared sourcessafe for services not yet upgraded
- Any warnings or hits left?YesFix them and run againNoRemove the migrator and release
- Delete old keysonce every consumer is upgraded
6 steps in order. Play them, or step through them one at a time.
6Follow-up questions
Can the migrator handle properties refreshed at runtime from the config server?
It reports what it sees at startup. Values that arrive later through a refresh event are not reported, so the startup run plus the repository search is the safer combination.
What if a config server file is shared by services on different Boot versions?
Put both the old and the new key in it during the transition. Old versions ignore the new key and new versions ignore the old one, so both work. Remove the old key when the last service has upgraded.
Is there a way to stop old keys from coming back?
Yes. A CI check that runs the same grep over the config and Helm repositories for the list of renamed keys fails the change that reintroduces one. It costs a few seconds per build.
7Conclusion
In this answer, we saw that ConfigMaps, environment variables and config server files all become property sources in one Environment, so the properties migrator reports old keys from all of them. Because it only sees what a run loads, we run every staging environment with it, search the application, config and Helm repositories for both spellings of each old key, add new keys before removing old ones in shared files, and remove the migrator only when everything is clean.
Open with
The good news is that the properties migrator works on the real Environment at runtime, not on files. By the time it runs, Boot has already imported the mounted ConfigMap files, the environment variables and the config server sources, so it reports an old key wherever it comes from, and it names the source in the report.
Then, if they want more
So my first step is to deploy the upgraded service with the migrator to every staging environment that mirrors a production configuration, each region and profile, and collect the PropertiesMigrationListener warnings from the logs into one list per service.
The catch is that it only sees what was loaded in that run, so profiles, other labels or rarely used configurations like disaster recovery are invisible.
For those I search the source: I take the renamed keys from Boot's metadata or the migration guide and grep the application repositories, the config server repository and the Helm charts, in both the dotted form and the environment variable form.
For shared config server files I add the new keys next to the old ones first, which is safe for services not yet upgraded, then upgrade, then delete the old keys. When staging runs are clean and the search finds nothing, I remove the migrator.
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 "Properties for your services come from application.yml, Kubernetes ConfigMaps and a...": https://scrivio-interview-library.netlify.app/spring-boot/boot-migrations/e87d677bc8/