Skip to content

Properties migrator does not migrate some properties renamed in 4.0 - #52801

Merged
philwebb merged 1 commit into
spring-projects:4.0.xfrom
beyondwin:properties-migrator-metadata-types
Nov 13, 2026
Merged

philwebb merged 1 commit into
spring-projects:4.0.xfrom
beyondwin:properties-migrator-metadata-types

Conversation

@beyondwin

Copy link
Copy Markdown
Contributor

The 4.0 migration guide recommends the properties migrator to keep renamed properties working during an upgrade, and #50767 pointed a MongoDB user to it. With only spring.data.mongodb.uri=mongodb://admin:secret@db.example:27017/orders set, the migrator reports "Replacement key 'spring.mongodb.uri' uses an incompatible target type", the URI stays unset, and the client connects to mongodb://localhost/test. Other 4.0 renames such as spring.session.redis.namespace, server.error.include-message and management.tracing.enabled are not migrated either.

The migrator only copies a property when its deprecated entry has the same type as the replacement. These entries have no type, while other renames in the same files, such as management.otlp.logging.endpoint, do.

This adds the replacement's type to each of them. Untyped entries for properties that had already stopped working before 4.0 are left as they are.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. label Nov 13, 2026
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. labels Nov 13, 2026
@philwebb philwebb added this to the 4.0.x milestone Nov 13, 2026
@philwebb philwebb self-assigned this Nov 13, 2026
The properties migrator only copies a renamed property when the type of
its deprecated entry matches the type of the replacement. Many entries
for properties that are no longer bound in 4.0 have no type, so the
migrator reported an incompatible target type and left the replacement
unset. For example, spring.data.mongodb.uri was not copied to
spring.mongodb.uri and the client connected to mongodb://localhost/test.

Record the replacement's type on each of these entries, and on the two
MongoDB metrics replacements that had none.

See spring-projectsgh-52801

Signed-off-by: WooSeung Kim <wooseung.dev@gmail.com>
@philwebb
philwebb force-pushed the properties-migrator-metadata-types branch from c2a90e4 to 9e19a30 Compare November 13, 2026 17:38
@philwebb
philwebb merged commit 778023c into spring-projects:4.0.x Nov 13, 2026
2 checks passed
@philwebb

Copy link
Copy Markdown
Member

Thanks @beyondwin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants