Undeleting a soft-deleted entry using a new RDN
In some cases, you can allocate the original Relative Distinguished Name (RDN), uid=user.1, to a new user. This is permitted when the entry is in a soft-deleted state. To properly undelete this entry, you must specify a new RDN value you can use to restore the entry.
About this task
In this case, specifying the RDN of uid=user.5 undeletes the original entry, but with the new distinguished name (DN) in the following example, and the uid attribute on the entry is updated with the new value of user.5. All other attributes of the users entry, including the entryUUID, remain unchanged.
To undelete a soft-deleted-entry using a new RDN:
Steps
-
Run the command
ldapmodifyto undelete a soft-deleted entry that has an original RDN,uid=user.1, to a new RDN,uid=user.5.If you specify a DN that already exists in the PingDirectory server as a normal entry, this leads to an
entry already existserror. Ensure the DN that you are undeleting the entry to does not already exist.Example:
$ bin/ldapmodify --allowUndelete dn: uid=user.5,ou=People,dc=example,dc=com changetype:add ds-undelete-from-dn: entryUUID=4e9b7847-edcb-3791-b11b-7505f4a55af4+uid=user.1,ou=People,dc=example,dc=com -
To view the results, run
ldapsearch.Example:
dn: uid=user.5,ou=People,dc=example,dc=com objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson postalAddress: Aartjan Aalders$59748 Willow Street$Green Bay, TN 66239 postalCode: 66239 description: This is the description for Aartjan Aalders. uid: user.5 userPassword: {SSHA}RdBCwQ2kIw57LukRthjrFBS/oFylJARnmTnorA== employeeNumber: 1 initials: AKA givenName: Aartjan pager: +1 197 025 3730 mobile: +1 890 430 9077 cn: Aartjan Aalders sn: Aalders telephoneNumber: +1 094 100 7524 street: 59748 Willow Street homePhone: +1 332 432 4295 l: Green Bay mail: user.3@maildomain.net st: TN entryUUID=4e9b7847-edcb-3791-b11b-7505f4a55af4Result:
The RDN and the
uidattribute has changed.