Directory migrations fail on security not at cutover but in the months either side: stale accounts are copied across, applications keep binding to the old servers, and the source directory lingers with live credentials long after everyone thinks it is gone. Whether you are consolidating several Active Directory domains, moving an LDAP directory to a cloud directory, or replatforming one LDAP server onto another, the same objects have to move and the same controls can quietly break. This playbook is vendor-neutral and covers what to inventory, how to handle passwords and service accounts, how to cut applications over and roll back, and how to decommission the source so it cannot be used again. It is for identity engineers, infrastructure leads and security architects. New directory rollouts are covered in the Directory service (LDAP and Active Directory) rollout playbook; domain-to-domain mechanics such as SID history are in the Active Directory Domain and Forest Migration Security Guide.
Key takeaways
- Clean before you copy: migrating dormant accounts, unused groups and excess delegations moves the risk to a new platform with a fresh audit trail that hides its age.
- Password handling is a design decision: hash import, reset on first sign-in and migration on successful bind each have different security and user impact, and hash formats are often incompatible.
- Applications are the long tail: every hard-coded bind account, server name and trusted certificate has to be found and changed, and some will only surface when the old server stops answering.
- Service accounts move last and differently: rebuild them with owners and least privilege in the target rather than copying their passwords and permissions.
- Decommissioning is a phase with exit criteria: zero binds, credentials revoked, data archived under retention rules and media sanitised, not a calendar date.
Migration patterns and what each changes
| Pattern | Typical driver | Main security change | Hardest part |
|---|---|---|---|
| Domain or forest consolidation | Mergers, divestments, reducing attack surface | Trusts collapse into one security boundary; privileged groups merge | Resource permissions that reference old security identifiers |
| LDAP directory to cloud directory | Retiring on-premises servers, SaaS-first strategy | Authentication moves from LDAP binds and Kerberos to federation and modern protocols | Legacy applications that can only speak LDAP |
| LDAP server replatform | End of support, licensing, performance | Same protocol, new access control model, schema and password storage | Translating access control instructions and password hash formats |
| Hybrid coexistence (long-term) | Gradual migration, regulatory or OT constraints | Two authorities for identity, kept in sync | Sync accounts with broad write rights and drift between sources |
Unsupported directory software is itself a finding under NIST SP 800-53 SA-22 Unsupported System Components, which is a useful lever for securing budget. For the trade-offs between cloud directories and domain controllers, see Cloud Directory vs Domain Controller.
What actually has to move
| Object | Why it matters | Typical decision |
|---|---|---|
| User accounts | Dormant and leaver accounts become valid accounts in the target (ATT&CK T1078.002) | Migrate only accounts with sign-in activity inside a defined window and a current HR or owner record |
| Groups and roles | Nested and unused groups carry hidden privilege | Flatten where possible; recreate privileged groups by hand with named members |
| Delegations and access control lists | Delegated rights to reset passwords or write attributes are rarely reviewed | Re-design delegation in the target; do not translate one for one |
| Password verifiers | Format may not be importable; weak legacy hashes should not survive | See the credential section below |
| Service and bind accounts | Long-lived passwords, broad read rights, no owner | Rebuild with owners, scoped rights and rotation |
| Schema extensions and custom attributes | Applications rely on them; some hold secrets | Migrate only attributes with a consumer; scan for passwords and keys first |
| Name resolution and endpoints | Service records, load balancer names and hard-coded server names steer clients | Plan alias redirection and a staged removal |
| Certificates and trust anchors | Clients pin or trust the old server certificate or issuing CA | Issue target certificates early and distribute the trust chain before cutover |
Directory attributes are a common hiding place for credentials. Scan description and custom fields before migration; see Secrets in Active Directory Attributes.
Handling passwords and credentials
NIST SP 800-63B-4 requires password verifiers to be salted and hashed with a suitable password hashing scheme resistant to offline attack, and recommends recording the scheme and cost factor per password so verifiers can migrate later. That last point is the heart of directory migration: if the source stores weak or unsalted hashes, importing them carries the weakness forward.
| Approach | How it works | Security trade-off | Choose it when |
|---|---|---|---|
| Hash import | Export verifiers from source and load them into the target in a supported format | No user disruption; preserves any weakness in the source format; export file is extremely sensitive | Source hashes meet current guidance and the target supports the format |
| Migrate on successful bind | Target or proxy checks the password against the source at first sign-in, then stores a new verifier | Re-hashes to a modern scheme; source must stay reachable during the window | Hash formats are incompatible or weak and you can run a transition period |
| Forced reset | Accounts created without a password; users enrol through a verified reset flow | Cleanest outcome; heavy help desk load; reset flow becomes a phishing target | Small populations, high-risk directories, or a move to passwordless |
- Protect the export: treat any hash export as a tier zero secret: encrypt it, limit access to named engineers, log every access and destroy it after load.
- Use the move to raise the bar: enforce phishing-resistant MFA for administrators in the target from day one, and consider passwordless enrolment for users instead of a reset. See the Passwordless and Passkeys Guide.
- Kerberos keys: in domain consolidations, accounts with service principal names are Kerberoasting targets (T1558.003); rebuilding them with long random secrets in the target removes the inherited weakness.
Where identity fits: service accounts and bind accounts
Non-human identities are where directory migrations most often lose control. Applications bind with a service DN and password that may be years old, shared between systems and held in configuration files. Inventory them from bind logs on the source servers, not only from naming conventions, then for each one:
- Assign a named owner. Unowned accounts go into a disable-and-watch queue. See How to assign owners to orphaned service accounts.
- Create a new account in the target with only the read scope the application needs, a new random secret stored in a secrets manager, and a rotation schedule.
- Move the application, confirm it binds successfully to the target, then disable (not delete) the source account.
- Prefer federation or workload identity over LDAP binds where the application supports it, which removes the static secret entirely.
Sync and provisioning connectors that write to both directories during coexistence usually hold broad write rights. Treat them as privileged identities, restrict where they can sign in from, and remove them at decommissioning. For an inventory method, see How to build a service account inventory from Active Directory.
The phased playbook
- Discover (4 to 8 weeks before): enable bind and authentication logging on source servers, record every client address and bind identity for at least one full business cycle (month end, quarter end), and build the application register from that data.
- Clean the source: disable dormant accounts, remove empty and unused groups, review privileged group membership and delegations. Changes in the source are reversible; migrated mistakes are harder to spot. For domain environments, the ASD-led joint advisory Detecting and Mitigating Active Directory Compromises, published with CISA, NSA, NCSC-UK and other partners, describes 17 common compromise techniques worth checking for before you copy anything.
- Build and harden the target: apply the target's hardening baseline, admin tiering and MFA before any data arrives. Require encrypted connections: RFC 4513 says servers should by default reject unauthenticated binds (a DN with an empty password), and name and password binds are not suitable without confidentiality protection, so enforce LDAPS or StartTLS with certificate validation. See How to fix LDAP signing and LDAPS errors when hardening domain controllers.
- Load and reconcile: migrate the cleaned population, then reconcile counts and privileged membership between source and target. Any privileged account in the target that has no approved record is a stop condition.
- Pilot applications: move low-risk applications first, then a representative legacy application, then business-critical systems. Keep a per-application rollback: revert the bind endpoint and credential to the source values held in change records.
- Cut over users: in waves by site or business unit, with the help desk briefed and reset flows monitored for abuse.
- Freeze the source: make it read-only for writes from people, keep it answering for a defined window, and alert on every bind it still receives.
- Decommission: follow the exit criteria below.
Rollback stays possible only while the source is current. Decide in advance the point after which rollback means rebuilding forward instead, usually when the source has been read-only for longer than the account change rate allows.
Decommissioning the old directory
Exit criteria before the source servers are switched off:
- Zero binds: no successful binds from production clients for a full business cycle. Each remaining client is either migrated or formally accepted as a risk with an owner.
- Credentials revoked: source service accounts, sync connector accounts and administrator accounts disabled, then deleted after the observation window; any secrets they shared with the target rotated.
- Trusts and federation removed: trusts, federation relationships and replication agreements that reference the source deleted, and firewall rules for directory ports (389, 636, 88, 3268 and 3269 where used) closed.
- Name resolution cleaned: service records and aliases removed so no client can rediscover the old servers.
- Data retained correctly: an export archived under the records retention schedule, encrypted, with access restricted. Do not keep a full live copy "just in case".
- Media sanitised: disks and backups of directory servers hold every password verifier; sanitise them before disposal or reuse in line with NIST SP 800-53 MP-6. See the Media Sanitisation Guide.
The Colonial Pipeline breach began with a legacy VPN account that was no longer used but had never been disabled. Every account left enabled in a "retired" directory, or still trusted by a VPN or application, is the same exposure.
Decision guidance
- Big bang or phased: big bang suits small, single-site directories with few applications; phased coexistence suits anything with legacy LDAP clients, but every month of coexistence keeps two attack surfaces and a privileged sync path alive. Set a hard end date.
- Proxy or rewrite for legacy LDAP applications: an LDAP proxy or compatibility service in front of the target buys time; rewriting to federation removes the static bind credential. Use the proxy as a bridge with a retirement date, not a destination.
- Consolidate or retire: in mergers, retiring the acquired directory entirely is usually safer than trusting it; a temporary trust should be one-way and filtered, as the forest migration guide explains.
- Small organisations: a forced reset with a guided enrolment day is often simpler and cleaner than hash import.
- Large organisations: invest in bind log analytics and an application register early; discovery, not data copy, sets the timeline.
Detection and measurement
Log bind and authentication events on both directories throughout, retain them past decommissioning, and alert on these signals:
- Successful binds to the source after the freeze date, by client and identity.
- Privileged group changes in either directory during coexistence.
- Use of migrated accounts with no sign-in history in the previous period (possible dormant account reactivation).
- Replication or directory synchronisation requests from unexpected hosts (ATT&CK T1003.006 DCSync in domain environments).
- Spikes in password reset or enrolment activity during user waves.
Metrics that show the migration is under control:
- Accounts excluded by cleaning: percentage of source accounts not migrated because they were dormant or unowned.
- Applications cut over: migrated applications against the register, tracked weekly.
- Source binds per day: trending to zero before decommissioning.
- Service accounts with owners: target 100 percent before cutover.
- Days from freeze to switch-off: against the planned window.
Common failure patterns
- Lift and shift of dormant accounts: every leaver and test account arrives in the new directory with a clean creation date.
- Copied delegations: help desk and application rights to reset passwords are translated one for one, including those nobody remembers granting.
- Unencrypted binds carried forward: legacy applications continue to send passwords in clear text to the new directory because the target accepted plain binds to ease migration.
- Zombie source directory: the old servers stay powered on for "reference", unpatched and still holding every password verifier.
- Forgotten sync connector: a provisioning account with write rights to the target remains after coexistence ends.
- Hash export left on a file share: the migration working folder keeps the verifier export long after load.
Framework mapping
| Migration activity | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | Other references |
|---|---|---|---|
| Account cleaning and disabling | AC-2, AC-2(3) | PR.AA-01 | CIS Controls v8.1 Control 5 Account Management |
| Delegation and group redesign | AC-2, AC-6 | PR.AA-05 | CIS Controls v8.1 Control 6 Access Control Management |
| Password verifier handling | IA-5, IA-5(1) | PR.AA-01 | NIST SP 800-63B-4 |
| Encrypted binds | SC-8 | PR.DS-02 | RFC 4513 |
| Change control and rollback | CM-3 | PR.PS-01 | Per-application rollback in change records |
| Inventory and retirement of servers | CM-8, SA-22 | ID.AM-08, PR.PS-02 | Application register built from bind logs |
| Sanitising retired servers and backups | MP-6 | PR.PS-03 | NIST SP 800-88 Rev. 2 |
| Bind and change logging | AU-2 | DE.CM-03 | ATT&CK T1078.002, T1003.006 |
Practitioner checklist
- Collect source bind logs for at least one full business cycle and build the application register from them.
- Disable dormant and unowned accounts in the source before migration.
- Choose the password approach based on source hash quality and target support, and protect any export as a tier zero secret.
- Rebuild service and bind accounts in the target with owners, scoped rights and vaulted secrets.
- Require LDAPS or StartTLS with certificate validation and reject unauthenticated binds in the target.
- Reconcile privileged group membership between source and target before user cutover.
- Keep a per-application rollback in change records until the source freeze window closes.
- Alert on every bind to the source after the freeze date.
- Decommission only against exit criteria: zero binds, revoked credentials, removed trusts, archived data, sanitised media.
Standards and references
- NIST: SP 800-53 Rev. 5, Security and Privacy Controls for Information Systems and Organizations
- NIST: SP 800-63B-4, Digital Identity Guidelines: Authentication and Authenticator Management
- IETF: RFC 4513, LDAP Authentication Methods and Security Mechanisms
- IETF: RFC 7644, System for Cross-domain Identity Management: Protocol
- CISA and partners: Detecting and Mitigating Active Directory Compromises
- NIST: SP 800-88 Rev. 2, Guidelines for Media Sanitization
- CIS: Critical Security Controls v8.1
- NIST: Cybersecurity Framework 2.0
Related NHI Mgmt Group resources: Directory service (LDAP and Active Directory) rollout playbook · Active Directory Domain and Forest Migration Security Guide · Active Directory and LDAP Health Check · Retiring Cleartext Protocols · Cloud Migration Security