3.5 Renaming or Moving an Entry

You can use an LDIF change record to rename an entry, move it, or do both in one operation. Modifying the DN uses two keywords and moving an entry requires a third keyword. These keywords have the following meaning:

Keyword

Description

newrdn

Indicates that this line contains the new RDN for the entry.

deleteoldrdn

Indicates whether the old RDN value should be deleted: 0=save, 1=delete. When the old value is saved, it becomes an additional attribute value but is no longer part of the entry's distinguished name.

newsuperior

Indicates that this line contains the DN of the new container for the entry.

Renaming an Entry. The following example shows how to rename an entry and retain the old value.

 version: 1
 
 dn: cn=Kim Jones, ou=English, ou=Humanities, o=UofZ
 changetype: moddn
 newrdn: cn= Kim Jones-Smith
 deleteoldrdn: 0
 
 

Moving an Entry. The following example shows how to move an entry from the English department to Spanish department.

 version: 1
 
 dn: cn=Kim Jones, ou=English, ou=Humanities, o=UofZ
 changetype: moddn
 newrdn: cn=Kim Jones
 deleteoldrdn: 1
 newsuperior: ou=Spanish, ou=Humanities, o=UofZ
 
 

Renaming and Moving an Entry. The following example shows how to rename and move an entry in the same operation.

 version: 1
 
 dn: cn=Kim Jones, ou=English, ou=Humanities, o=UofZ
 changetype: moddn
 newrdn: cn=Kim Jones-Smith
 deleteoldrdn: 0
 newsuperior: ou=Spanish, ou=Humanities, o=UofZ