Ldapmodify help needed

Just decommissioned a Primary node and have a few bits in LDAP that need to be changed.

Current entry:

# failover, ucs-9410, dhcp, fqdn.com
dn: cn=failover,cn=ucs-9410,cn=dhcp,dc=fqdn,dc=com
dhcpMaxClientLeadTime: 600
objectClass: dhcpFailOverPeer
dhcpFailOverSecondaryPort: 5020
dhcpFailOverSplit: 128
dhcpFailOverSecondaryServer: 10.0.1.238
dhcpFailOverPrimaryPort: 5019
dhcpFailOverPrimaryServer: 10.0.1.231
cn: failover

How do I change the dn: entry to:

dn: cn=failover,cn=ucs-9412,cn=dhcp,dc=fqdn,dc=com ??

I’ve attempted the change using
changetype: moddn
newrdn: cn=failover,cn=ucs-9412

However, it errors out with an Invalid DN syntax.

Using just the cn=ucs-9412 replaces the cn=failover with:

cn=ucs-9412,cn=ucs-9410,cn=dhcp,dc=fqdn,dc=com

For anyone who bumps into this issue as well, here’s what I did and the LDAP syntax needed to accomplish the change.

Create New DHCP Service

  1. Create a new DHCP Service entry for the server replacing the decommissioned Master/Primary. This is accomplished in the LDAP web interface in UCM. Your {base_dn} → dhcp, + ADD.

  2. Under Add a new LDAP object, chose Type DHCP: Service.

  3. Enter your new server host name in the ‘Service name’ field and ‘Create LDAP Object.’

Modify Existing LDAP Entry

kinit Administrator
oldHost={your decommissioned server host name}
newHost={your new Primary server host name}
ldapmodify -Y GSSAPI <<_LDIF_
dn: cn=failover,cn=$oldHost,cn=dhcp,dc=domain,dc=tld
changetype: moddn
newrdn: failover
deleteoldrdn: 1
new superior: cn=$newHost,cn=dhcp,dc=domainname,dc=tld  *<-- replace with your particulars*  
_LDIF_

If everything goes well, your get a response similar to:
modifying ran of entry "dn: cn=failover,cn=ucs-9410,cn=dhcp,dc=domain,dc=tld"

The old Service record for the decommissioned can be removed.

The final step is to update the dhcpFailOverPrimaryServer: entry.

In this case, I used
ldapmodify again.

ldapmodify -Y GSSAPI <<_LDIF_
dn: cn=failover,cn=$newHost,cn=dhcp,dc=domainname,dc=tld
changetype: modify
replace: dhcpFailOverPrimaryServer
dhcpFailOverPrimaryServer: {IP Address of new Primary Host}
_LDIF_

Restart DHCP Service

On both servers:

systemctl restart isc-dhcp-server.service

Hope this helps.