Renaming an Entry Using LDIF

changetype: add

objectclass: top

objectclass: groupOfNames

member: cn=Sue Jacobs,ou=People,dc=example,dc=com

member: cn=Pete Minsky,ou=People,dc=example,dc=com

cn: Administrators

dn: ou=example.com Bolivia\, S.A.,dc=example,dc=com

changetype: add

objectclass: top

objectclass: organizationalUnit

ou: example.com Bolivia\, S.A.

dn: cn=Carla Flores,ou=example.com Bolivia\,S.A.,dc=example,dc=com

changetype: add

objectclass: top

objectclass: person

objectclass: organizationalPerson

objectclass: inetOrgPerson

cn: Carla Flores

givenName: Carla

sn: Flores

ou: example.com Bolivia\, S.A.

uid: cflores

4.2. Renaming an Entry Using LDIF

changetype: modrdn changes an entry's relative distinguished name (RDN). An entry's RDN is the left-most element in the distinguished name. The RDN for cn=Barry Nixon,ou=People,dc=example,dc=com is cn=Barry Nixon, and the RDN for ou=People,dc=example,dc=com is ou=People. A changetype: modrdn operation changes that left-most value in an entry's DN.

The modrdn change type only changes teh RDN; it cannot change other parts of a DN. For example, the entry cn=Sue Jacobs,ou=People,dc=example,dc=com can be changed to cn=Susan Jacobs,ou=People,dc=example,dc=coma, but it cannot be modified to be cn=Sue Jacobs,ou=old employees,dc=example,dc=com.

The following command renames Sue Jacobs to Susan Jacobs:

dn: cn=Sue Jacobs,ou=Marketing,dc=example,dc=com

changetype: modrdn

newrdn: cn=Susan Jacobs

deleteoldrdn: 0

Because deleteoldrdn is 0, this example retains the existing RDN as a value in the new entry. The resulting entry would therefore have a common name (cn) attribute set to both Sue Jacobs and Susan Jacobs, in addition to all the other attributes included in the original entry. However, using the following command causes the server to delete cn=Sue Jacobs, so that only cn=Susan Jacobs remains in the entry:

35

Page 55
Image 55
HP UX Red Hat Direry Server Software Renaming an Entry Using Ldif, Following command renames Sue Jacobs to Susan Jacobs