Modrdn is the LDIF changeType directive for ModifyDNRequest.
Modrdn MUST be followed by a NewRDN directive and may be followed by a DeleteOldRDN and a NewSuperior directive.
Typically depending on the LDAP Server Implementation you CANNOT rename the LDAP Entry if the entry has one or more child entries.
dn: cn=Robert Ssmith,ou=people,dc=example,dc=com # following sequence renames the above DN to # cn=Robert Smith,ou=people.dc=example,dc=com # and deletes the entry # cn=Robert Ssmith,ou=people,dc=example,dc=com changetype: modrdn newrdn: cn=Robert Smith deleteoldrdn: 1
Here are the keywords and descriptions:
version: 1 dn: cn=johndoe, ou=provo, ou=users, o=novell changetype: moddn newrdn: cn= jimmydoe deleteoldrdn: 0
version: 1 dn: cn=johndoe, ou=provo, ou=users, o=novell changetype: moddn newrdn: cn=johndoe deleteoldrdn: 1 newsuperior: ou=toronto, ou=users, o=novell
version: 1 dn: cn=johndoe, ou=provo, ou=users, o=novell changetype: moddn newrdn: cn=jimmydoe deleteoldrdn: 0 newsuperior: ou=toronto, ou=users, o=novell
# moves the entry from people to expeople dn: cn=Robert Smith,ou=people,dc=example,dc=com changetype: modrdn # NOTE: rdn unchanged newrdn: cn=Robert Smith # deletes old entry deleteoldrdn: 1 # adds to expeople hierarchy newsuperior: ou=expeople,dc=example,dc=com
# makes a copy of the entry in expeople dn: cn=Robert Smith,ou=people,dc=example,dc=com changetype: modrdn # NOTE: rdn unchanged newrdn: cn=Robert Smith # keeps current entry deleteoldrdn: 0 # adds to expeople hierarchy newsuperior: ou=expeople,dc=example,dc=comcom]