§ 06 · LDAP / ACTIVE DIRECTORY · MIGRATION
Migrating from old HiveCFM
Same directory, same users, different server. Six old keys become a handful of fields, and Windows stops doing some work for you.
The old .NET HiveCFM ran on Windows under IIS and read its LDAP settings from web.config (and the auth plugin’s .dll.config). The new HiveCFM runs as a Linux container and keeps the settings in the database, edited on the Organization settings → LDAP page. Nothing is copied automatically: you read the old values and type them into the new page once.
Old keys → new fields
The example uses the made-up domain bank.example. Field numbers refer to the markers in the Setup guide.
| Old key | Old value (example) | New field # | What to type in the new page |
|---|---|---|---|
LDAPServer | dc01.bank.example:636 | 4 + 5 | Server host = dc01.bank.example, Port = 636 (the parts before and after the colon). |
| — | — | 2 + 3 | Mode = Direct, Security = LDAPS (the old value used port 636, which is LDAPS). |
LDAPDomain | bank.example | 8 | Base DN = DC=bank,DC=example. Each part of the domain becomes DC=. |
LDAPUser | svc-hivecfm | 9 | Bind user = svc-hivecfm@bank.example (user + @ + domain). |
LDAPPassword | (service account password) | 10 | Bind password. Ask the customer for it; do not copy it around in chat or email. It is stored encrypted and never shown again. |
LDAPPath | ldaps://CN=svc-hivecfm,OU=Service Accounts,DC=bank,DC=example | — | Not needed. It is the full address of the same service account. If you prefer, you can paste it into Bind user without the ldaps:// prefix (a full DN is accepted). If it contains &, write it as &. |
LDAPNetBIOSDomainName | EXAMPLE | — | Nothing to type. Users can still sign in as EXAMPLE\jane.smith; HiveCFM removes the EXAMPLE\ part. |
| (none) | — | 6 | CA certificate: the customer’s root CA in PEM. Windows trusted it automatically; the container must be told. |
The old auth plugin config stored the service account password in plain text on the Windows server. After the cut-over, ask the customer to change that password and enter the new one in HiveCFM. Then the old copy is useless.
Windows (old) vs Linux container (new)
The directory is the same. What changes is everything Windows did silently because the old server was joined to the customer’s domain.
| Area | Old: Windows / IIS, domain-joined | New: Linux container | What the customer must do |
|---|---|---|---|
| How the password is checked | Windows “Negotiate” (Kerberos or NTLM). On port 389 the traffic was signed and sealed by Windows. | A simple bind: HiveCFM sends the person’s DN and password to the DC. Node.js has no Windows Kerberos support. | Provide LDAPS (636) or StartTLS (389) so the password is encrypted. Plain 389 sends it in clear, and DCs that require signing refuse it. |
| Finding the DC | The domain-joined server found DCs through the domain’s DNS. | The container uses the hosting network’s DNS, which usually knows nothing about the AD domain. | Use Direct mode with the DC’s name or IP. Standard mode only works if a DNS zone or forwarder for the AD domain is added. |
| Certificate trust | The Windows certificate store already trusted the company CA. | No Windows store. Trust comes from the CA PEM pasted in the settings. | Export the root (and intermediate) CA as Base-64 .cer. |
| Name check on the certificate | Hidden by Kerberos. | Strict: the name you connect to must appear in the DC’s certificate. Connecting by IP fails with LDAP_TLS_HOSTNAME_MISMATCH unless the certificate lists that IP. | Connect by the DC’s DNS name, or have the DC certificate re-issued with the IP in it. |
| Username formats | DOMAIN\user, UPN, short name. | The same three. DOMAIN\ is removed, then a search by short name or UPN, then a bind as the found account. | Nothing; tell users all three formats work. |
| What identifies a person | Short name / UPN plus objectGUID (CFMUser.Guid). | The directory objectGUID, stored in the same text format as the old CFMUser.Guid, plus the email from mail. | Every user needs a mail value, or an email-shaped UPN. |
| Error messages | Nearly everything became “invalid password”. | Clear messages for disabled, expired and must-change accounts. A locked account still shows “Invalid username or password.” on purpose (see Security). | Update the helpdesk script. |
| Firewall path | IIS server inside the company LAN. | Traffic leaves the container host (or cloud network) towards the DC. | Open TCP 636 (or 389 for StartTLS) from the HiveCFM host to the DC. |
| Where the config lives | web.config and the plugin .dll.config, password in clear. | One database row, instance_ldap_config, with the bind password encrypted by ENCRYPTION_KEY. | Enter the values once in the settings page. |
| Group → role | Old groups mapped to roles at each login. | Not implemented. New users get no access until an admin adds them. | Plan an onboarding step: an owner adds people up front with Add from directory, or adds them from the waiting card after their first sign-in. |
| Break-glass | Local sysadmin path. | Administrator sign-in (/auth/login?mode=local) for organization owners (any organization) with a local password, plus the LDAP_AUTH_DISABLED=1 kill switch. | Keep one local owner account and its password safe. |
| Clock | Kerberos needed under 5 minutes of clock skew. | Not needed for the bind, but TLS needs a correct clock to check certificate dates. | NTP on the host. |
| Email trust | Email was not an identity. | New users are created with their email marked verified, taken from the directory. Pending invites match by email. | Make sure people cannot edit their own mail in the directory (AD default: only admins can). |
A worked example
The customer’s old web.config has LDAPServer = dc01.bank.example:636, LDAPDomain = bank.example, LDAPUser = svc-hivecfm and LDAPNetBIOSDomainName = EXAMPLE. The new settings are:
| Field | Value |
|---|---|
| Mode | Direct (server / IP) |
| Security | LDAPS (636, recommended) |
| Server host or IP | dc01.bank.example |
| Port | 636 (or blank) |
| CA certificate | the customer’s root CA, PEM |
| Verify server certificate | On |
| Base DN | DC=bank,DC=example |
| Bind user | svc-hivecfm@bank.example |
| Bind password | from the customer |
| Email attribute / Name attribute | mail / displayName |
| User filter | the default |
Then test with EXAMPLE\jane.smith, save, and follow the rest of the Setup guide.
Existing users from the old system
If the customer’s data was migrated from the old HiveCFM, the old user rows are not linked to directory accounts by the migrator today. A directory user is created fresh on their first LDAP sign-in, or earlier by an owner with Add from directory.
Watch for one trap: if a migrated or hand-made HiveCFM account already exists with the same email as a directory person, and that account is not an LDAP account, the directory sign-in is refused with “An account with this email already exists. Contact your administrator.” (LDAP_EMAIL_CONFLICT). HiveCFM never merges a local account into a directory account automatically, because that would let whoever controls the directory email take over the local account. See Troubleshooting for how to resolve it.