Migrating the LDAP configuration from application.yml
LDAP providers that are configured in application.yml (or via LDAP_* environment variables) can be moved to the LDAP configuration in the Relution portal →. The provider name is what matters: if it matches the previous name exactly, Relution recognizes the users and groups it has already imported and updates them instead of creating them again.
Prerequisites
The migration requires the following:
- A paid license with the LDAP UI Connections feature. Providers in
application.ymldo not need this license, providers in the Relution portal do. - Write access to
application.ymlor the environment variables of the Relution server, and the ability to restart the server. - Access to the server log of the last start (see Relution Logs →).
- An administrator account in the organization the provider is currently assigned to (
organizationUniqueNameinapplication.yml), or in the global or a meta organization if the provider distributes objects to several organizations.
Procedure
The migration takes four steps:
- Determine the current provider name.
- Create the provider in the Relution portal with exactly this name and copy the remaining values.
- Remove the provider from
application.ymland restart the server. - Verify the result.
The order matters. As long as the provider exists in application.yml, it takes precedence. A provider with the same name in the Relution portal can be saved and tested, but only becomes active once the YAML provider has been removed and the server restarted. If the YAML provider is removed first, LDAP users cannot sign in until the provider has been created in the portal.
Determine the provider name
Relution stores the name of the provider on every imported user and group. During synchronization and sign-in, only objects with exactly this name are assigned to the provider, including upper and lower case and spaces.
Name in application.yml
In application.yml, LDAP providers are listed under the ldap key. The name is determined as follows:
- If the provider has a
nameproperty, its value is the name. - If
nameis missing, the provider’s key is the name, i.e. the entry directly underldap.
In the following example, the first provider is named School North, the second administration:
ldap:
north:
name: School North
ldap_urls:
- ldaps://dc1.school.local:636
ldap_base: dc=school,dc=local
administration:
ldap_urls:
- ldap://dc2.administration.local:389
ldap_base: dc=administration,dc=local
Name when configured via environment variables
The default key is an exception. Relution ships a built-in preset for it that is filled from environment variables (LDAP_URL, LDAP_BASE etc.), for example in Docker installations. This preset sets the name to the value of LDAP_NAME. If LDAP_NAME is not set, the name is <ORGA_NAME> LDAP Configuration, where <ORGA_NAME> is the value of the environment variable of the same name. This also applies if ldap.default appears in a custom application.yml without name.
Check the name in the server log
Regardless of how it is derived, the server log shows the name actually used. At startup, Relution writes a line like this for every provider from application.yml:
Register static LDAP security provider with name "School North" (ContextRefreshedEvent)
The text between the quotation marks is what counts. It is copied to the Relution portal unchanged, including all spaces.
Create the provider in the Relution portal
The new provider is created in the organization the YAML provider is currently assigned to:
- Open
Settings→LDAP synchronisationand click Add. - Enter the determined name exactly in the Provider name field.
- Copy the remaining values from
application.ymlto the corresponding fields (see table below). - Set When an LDAP user is not found to Disable the user in Relution at most, even if
application.ymlwas configured withdelete. - Check the connection with Test network connection and Test authentication, then the imports with Test user import and Test group import.
- Save the configuration.
The restriction in step 4 applies to the first synchronization after the migration. If a filter was copied incorrectly, this synchronization does not find some of the users. With Delete the user from Relution, these users and their links would be removed irrevocably; if a later synchronization finds them again, new accounts are created without the previous device and group assignments. Disabled users, on the other hand, are kept with all their links and are enabled again automatically by the next synchronization once the filter is corrected, unless they are locked in the LDAP itself. If a synchronization returns no results at all, Relution always applies Do nothing as a precaution.
Most values can be copied as they are. Keys in application.yml may be written in different styles (ldap_base, ldap-base or ldapBase); the table shows the common form.
| Key in application.yml | Field in the Relution portal | Description |
|---|---|---|
name or key | Provider name | Copy exactly, see Determine the provider name |
ldap_urls | LDAP Server URLs | Enter each URL separately and confirm with Enter |
ldap_userDn | Bind DN or user | Unchanged |
_ldap_password | Bind password | Unchanged. The portal has no ldap_password_url; the password is entered directly |
ldap_base | Base DN | Unchanged |
trustAllCertificates | Trust all certificates | Enabled by default in application.yml, but not in the portal. For LDAPS, store the server certificate under Trusted server certificates |
user_searchBase, user_searchFilterTemplate | User search base, User search filter | Unchanged |
user_searchScope | User search scope | 0 = Object, 1 = One level, 2 = Subtree |
manual_user_mapping, user_attribute_* | Manual user attribute mapping | Attribute names unchanged, especially user_attribute_foreignKey |
sync_users, sync_interval | Periodic user import, Synchronization time | The portal synchronizes once a day at a fixed time instead of at an interval |
sync_users_action_when_missing | When an LDAP user is not found | none = Do nothing, disable = Disable the user in Relution, delete = Delete the user from Relution |
group_syntheticGroup | Synthetic group | See Synthetic groups |
group_useGroups | Import groups of imported users | Unchanged |
sync_groups | Periodic group import | Time as for users |
group_searchBase, group_searchFilterTemplate, group_searchScope | Group search base, Group search filter, Group search scope | Unchanged |
manual_group_mapping, group_attribute_* | Manual group attribute mapping | Attribute names unchanged |
edu_*, sync_edu_objects | Education section | Search bases, filters and search scopes unchanged |
organization*Filters | Map objects to organizations | Only in the global or a meta organization, filters per target organization |
Some options of application.yml have no equivalent in the Relution portal and are dropped during the migration:
- Filter-based synthetic groups (
syntheticGroup_<Name>,syntheticGroup_json) and additional group assignments viagroupRoles_json(see Synthetic groups). - Synchronization intervals (
sync_interval,sync_groups_interval); there is only the daily time. ldap_password_url, connection timeouts,user_acl/group_acland theconfiguration-templatefor several organizations. For the template, a separate provider is created per organization, or the distribution is set up via Map objects to organizations.
Synthetic groups
The Relution portal supports only one synthetic group per provider: the group that all users imported through the provider are added to. It corresponds to group_syntheticGroup in application.yml.
- Value present: The same value is entered in the Synthetic group field, without the organization prefix.
group_syntheticGroup: LDAP UsersbecomesLDAP Users, and the existing groupMYORG LDAP Usersis kept. - No value present: The field is prefilled with
LDAPin the portal and is cleared. Otherwise the first synchronization creates a new groupMYORG LDAP.
Filter-based synthetic groups (syntheticGroup_<Name>: <LDAP filter>) and assignments via groupRoles_json are not supported by the portal. These groups are deleted in Relution by the first successful synchronization after the migration, together with the roles and permissions assigned to them. This cannot be turned off. Required groups are created in the LDAP instead and imported via group synchronization. Roles and permissions previously attached to such a group are then assigned to the imported LDAP group.
Remove the YAML configuration
application.yml is only read when the server starts. For the provider from the Relution portal to become active, the YAML provider is removed and the server restarted:
- Delete the provider’s section under
ldapfromapplication.yml. When configured via environment variables, remove theLDAP_*variables, at leastLDAP_BASE: without a base DN, Relution does not register thedefaultprovider. - Restart the Relution server.
If the YAML provider remains, Relution writes a warning to the log at startup, and the provider with the same name in the portal stays inactive:
Cannot register dynamic security provider "School North" (…), conflicts with an existing static provider
Later changes to the provider in the Relution portal take effect immediately; no restart is required.
Verify the result
After the restart, the migration is verified as follows:
- The server log no longer contains a line
Register static LDAP security providerfor the provider, and no warningconflicts with an existing static provider. - Under
Settings→LDAP synchronisation, select the provider and click Start synchronization. - On the provider’s detail page, the synchronization result shows updated users and groups, but no errors such as “could not be synced because it is a duplicate of”.
- An LDAP user signs in to the Relution portal or a Relution app as a test.
If the result is correct, When an LDAP user is not found can be switched to Delete the user from Relution if required.
If the synchronization reports duplicates, the Provider name does not match the previous name. Since the name cannot be changed, the provider is deleted in the portal and created again with the correct name.