Univention Bugzilla – Bug 46357
Migrate person only accounts to address book entries
Last modified: 2018-03-14 14:38:07 CET
See Bug #46117. The migration script should migrate the person only objects to address book entries. The diagnostic module should honor it as well.
Ok, I adjusted the migration script so users created with "person" option only will not be upgraded to a full user. I just change univentionObjectType to users/contact. Changelog enty not required, I think, that's covered by Bug 45842.
OK # contact, users, four.two dn: uid=contact,cn=users,dc=four,dc=two displayName: contact uid: contact objectClass: person objectClass: univentionPWHistory objectClass: univentionObject objectClass: organizationalPerson objectClass: top objectClass: inetOrgPerson sn: contact cn: contact univentionObjectType: users/contact
As discussed the migration script needs to be adjusted. The rdn for a users/contact object is the firstname(optional) and lastname concatenated plus a running number for every object with the same firstname+lastname. e.g.: cn=Max Meier 1,cn=users,dc=mydomain,dc=intranet cn=Max Meier 2,cn=users,dc=mydomain,dc=intranet cn=Max Meier 1,cn=other_users,dc=mydomain,dc=intranet The migration script changes the object type but the rdn is still uid=***.
c76378ed74 | rename uid= to cn= when migrating users/user to users/contact b9bdcbd7c7 | changelog-4.3-0.xml That way we have a) cn unique and b) we don't lose customer provided identity information. After that cn is multivalue (old value and uid). Manual renaming via UMC makes it single value again.
added four contacts uid=username,cn=users,dc=fb,dc=bf uid=username2,cn=users,dc=fb,dc=bf uid=username3,cn=users,dc=fb,dc=bf uid=username4,cn=users,dc=fb,dc=bf -> /usr/share/univention-directory-manager-tools/univention-migrate-users-to-ucs4.3 --check Ignoring non users/user account: uid=sys-idp-user,cn=users,dc=fb,dc=bf Renaming uid=username,cn=users,dc=fb,dc=bf to cn=username,cn=users,dc=fb,dc=bf Modifying cn=username,cn=users,dc=fb,dc=bf [('univentionObjectType', 'users/user', 'users/contact')] Renaming uid=username2,cn=users,dc=fb,dc=bf to cn=username,cn=users,dc=fb,dc=bf Modifying cn=username,cn=users,dc=fb,dc=bf [('univentionObjectType', 'users/user', 'users/contact')] Renaming uid=username3,cn=users,dc=fb,dc=bf to cn=username,cn=users,dc=fb,dc=bf Modifying cn=username,cn=users,dc=fb,dc=bf [('univentionObjectType', 'users/user', 'users/contact')] Renaming uid=username4,cn=users,dc=fb,dc=bf to cn=username,cn=users,dc=fb,dc=bf Modifying cn=username,cn=users,dc=fb,dc=bf [('univentionObjectType', 'users/user', 'users/contact')] -> /usr/share/univention-directory-manager-tools/univention-migrate-users-to-ucs4.3 Ignoring non users/user account: uid=sys-idp-user,cn=users,dc=fb,dc=bf Renaming uid=username,cn=users,dc=fb,dc=bf to cn=username,cn=users,dc=fb,dc=bf Modifying cn=username,cn=users,dc=fb,dc=bf [('univentionObjectType', 'users/user', 'users/contact')] Renaming uid=username2,cn=users,dc=fb,dc=bf to cn=username,cn=users,dc=fb,dc=bf Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-migrate-users-to-ucs4.3", line 471, in <module> Migration() File "/usr/share/univention-directory-manager-tools/univention-migrate-users-to-ucs4.3", line 79, in __init__ self.migrate_users() File "/usr/share/univention-directory-manager-tools/univention-migrate-users-to-ucs4.3", line 162, in migrate_users self.rename(dn, newdn) File "/usr/share/univention-directory-manager-tools/univention-migrate-users-to-ucs4.3", line 349, in rename lo.rename(dn, newdn, serverctrls=serverctrls, ignore_license=True) File "/usr/lib/pymodules/python2.7/univention/admin/uldap.py", line 528, in rename raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg) univention.admin.uexceptions.ldapError: Already exists contact cn's should be firstname + lastname + once (username or counter) if firstname is none, use username instead if lastname is none, use username instead
(In reply to Felix Botner from comment #5) > contact cn's should be firstname + lastname + once (username or counter) > if firstname is none, use username instead > if lastname is none, use username instead lastname is q mandatory attribute, so this should always exist
Ok, I have adjusted the script to generate this: Renaming uid=user25,cn=users,dc=ar41i1,dc=qa to cn=first25 name25 (user25),cn=users,dc=ar41i1,dc=qa Modifying cn=first25 name25 (user25),cn=users,dc=ar41i1,dc=qa [('cn', ['first25 name25', 'first25 name25 (user25)'], ['first25 name25 (user25)']), ('univentionObjectType', 'users/user', 'users/contact')] Package: univention-directory-manager-modules Version: 13.0.21-11A~4.3.0.201803061729 Branch: ucs_4.3-0
OK these old user objects (contact only) dn: uid=username,cn=users,dc=four,dc=three displayName: Vornam Nachname uid: username dn: uid=username2,cn=users,dc=four,dc=three displayName: Vornam Nachname uid: username2 # username3, users, four.three dn: uid=username3,cn=users,dc=four,dc=three displayName: Vornam Nachname uid: username3 dn: uid=userÖÄ)\3D)(\3D ÄÖ'ÄÖ,cn=users,dc=four,dc=three displayName: Vornam Nachname uid: userÖÄ)\3D)(\3D ÄÖ'ÄÖ are migrated to contacts: udm users/contact list| grep DN DN: cn=Vorname Nachname (username),cn=users,dc=four,dc=three DN: cn=Vorname Nachname (username2),cn=users,dc=four,dc=three DN: cn=Vorname Nachname (username3),cn=users,dc=four,dc=three DN: cn=Vorname Nachname (userÖÄ)\3D)(\3D ÄÖ'ÄÖ),cn=users,dc=four,dc=three
UCS 4.3 has been released: https://docs.software-univention.de/release-notes-4.3-0-en.html https://docs.software-univention.de/release-notes-4.3-0-de.html If this error occurs again, please use "Clone This Bug".