HP-UX Directory Server 8.1 administrator guide
newrdn: cn=Susan Jacobs
deleteoldrdn: 1
3.4.2.1 A Note on Renaming Entries
The modrdn change type cannot move an entry to a completely different subtree. To move an
entry to a completely different branch, you must create a new entry in the alternative subtree
using the old entry's attributes, then delete the old entry.
Also, for the same reasons that you cannot delete an entry if it is a branch point, you cannot
rename an entry if it has any children. Doing so would orphan the children in the tree, which is
not allowed by the LDAP protocol. For example, of the following three entries, only the last two
entries can be renamed:
ou=People,dc=example,dc=com
cn=Paula Simon,ou=People,dc=example,dc=com
cn=Jerry O'Connor,ou=People,dc=example,dc=com
The entry that identifies the People subtree can be renamed only if no other entries exist below
it.
3.4.3 Modifying an entry using LDIF
changetype: modify can add, replace, or remove attributes or attribute values in an entry.
When you specify changetype: modify, you must also provide a change operation to indicate
how the entry is to be modified. Change operations can be as follows:
• add: attribute
Adds the specified attribute or attribute value. If the attribute type does not currently exist
for the entry, then the attribute and its corresponding value are created. If the attribute type
already exists for the entry, then the specified attribute value is added to the existing value.
If the particular attribute value already exists for the entry, then the operation fails, and the
server returns an error.
• replace:attribute
The specified values are used to entirely replace the attribute's values. If the attribute does
not already exist, it is created. If no replacement value is specified for the attribute, the
attribute is deleted.
• delete:attribute
The specified attribute is deleted. If more than one value of an attribute exists for the entry,
then all values of the attribute are deleted in the entry. To delete just one of many attribute
values, specify the attribute and associated value on the line following the delete change
operation.
This section contains the following topics:
• “Adding attributes to existing entries using LDIF”
• “Changing an attribute value using LDIF”
• “Deleting all values of an attribute using LDIF”
• “Deleting a specific attribute value using LDIF”
3.4.3.1 Adding attributes to existing entries using LDIF
Using changetype: modify with the add operation cam add an attribute and an attribute
value to an entry. For example, the following LDIF update statement adds a telephone number
to the entry:
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
add: telephonenumber
telephonenumber: 555-1212
3.4 LDIF update statements 123