[Samba] Copy additional LDAP attributes on migration from ldap

mourik jan heupink heupink at merit.unu.edu
Tue Nov 12 01:23:46 MST 2013

> Something like this (untested):
>      ldapsearch -H oldplace mail dn |
>      while read attr val
>      do  case $attr in
>            (dn:)   dn=$val;;
>            (mail:) mail=$val
>                    printf 'dn: %s\nmail: %s\n\n' "$dn" "$mail";;
>          esac
>      done |
>      ldbmodify -H tdb:///path/to/sam.ldb
> Rinse and repeat for each attribute you care about.
Interesting, thanks, this should get me going.

While googling the above, I found this statement from Andrew Bartlett:

>>  ldbmodify -H /usr/local/samba/private/sam.ldb.d/DC\=<DOMAIN>.ldb -U
>> administrator 03_smb_maps.ldif
> You now have a corrupt database.  Please wipe the database, and start
> again, hopefully from a backup.
> Andrew Bartlett

But your "ldbmodify -H tdb:///path/to/sam.ldb" should be safe?

More information about the samba mailing list