[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[K12OSN] ldap problems fixed/need help with ldif script



We have been fighting with samba 3.0, and moving from our old ldap database(samba 2.2.8/idealix smbldap-tools), to ldapsam_compat on samba 3.
We are keeping the compat, because of needing to use the idealix smb-tools scripts fro adding users...they are just more complete, than smbpasswd adding users.
anyway...
We would dump our 2.2.8 ldap info out with a slapcat < backup.ldif, then import it into another machine with slapadd < backup.ldif


***Do Not Use slapadd!!!! It does not work.****

we would get all of our users added back from a slapcat dump, and then we could not communicate with the ldap again...logs kept saying permission denied...
apparently, the extra feilds you get with a slapcat when creating a backup ldif file, such as :
structuralObjectClass: inetOrgPerson
entryUUID: 6610afe4-0483-1027-9a9c-94a42655b8a5
entryCSN: 2003051416:53:37Z#0x0001#0#0000


these must mess up the ldap database when slapadding them back in to an empty database.
if we take say our groups out of the backup.ldif, and delete any extra lines that look like above,
and put it in a groups.ldif
then use this command:
ldapadd -x -h localhost -D "cn=Manager,dc=bryantschools,dc=org" -f groups.ldif -W


then things are hunky dory :-)

so, now we are stuck with a backup.ldif of users, that is full of the

structuralObjectClass: inetOrgPerson
entryUUID: 6610afe4-0483-1027-9a9c-94a42655b8a5
entryCSN: 2003051416:53:37Z#0x0001#0#0000

entries.....does anyone have a script, or know of an easy way to look for any lines starting with:
structuralObjectClass:
entryUUID:
entryCSN:


and just delete them...?
then we can use the ldapadd command above, and get our database squared away...


Thanks,
Barry Smoke
District Network Administrator
Bryant Public Schools









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]