[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: question about openldap restore with command sldapadd



Quanah,
 
Thanks for your response!  I got it.
 
but why openldap will not skip the insert when the entry already existed. I found some code in openldap already handle like this, anyway, it could take some effort.
 
  rc = mdb_cursor_put( mc, &key, data, MDB_NODUPDATA|MDB_APPEND|MDB_MULTIPLE );
                        if ( rc ) {
                                if ( rc == MDB_KEYEXIST ) {
                                        rc = 0;
                                        continue;
                                }
                                rc = -1;
                                break;
                        }

 
Thanks,
Eric.
 
> Date: Tue, 25 Mar 2014 18:17:44 -0700
> From: quanah@zimbra.com
> To: ericxiaomingzhao@hotmail.com; openldap-technical@openldap.org
> Subject: RE: question about openldap restore with command sldapadd
>
>
> --On Wednesday, March 26, 2014 10:03 AM +0800 xiaoming zhao
> <ericxiaomingzhao@hotmail.com> wrote:
>
> >
> > Quanah,
> > All,
> >
> > So openldap can't skip to add the entry if there is already an existing
> > entry? in other database, the insert operation will check the entry
> > exists or not. if exist, do nothing. if not exist, then insert it. there
> > are other operation like insertupdate.
> >
> > do we have any option to skip the existing entry?
>
> slapadd is a tool used for BULK RESTORATION of the ENTIRE DB. You can skip
> using -c, but it will skip ALL errors. You are *not* using the right tool
> for what you are attempting to do.
>
> If you want to do something else, try the ldapdiff utility
> (<http://www.openldap.org/faq/data/cache/612.html>) and use that to diff
> your current db and your backup, and then use ldapadd to add the missing
> entries.
>
> --Quanah
>
>
>
> --
>
> Quanah Gibson-Mount
> Architect - Server
> Zimbra, Inc.
> --------------------
> Zimbra :: the leader in open source messaging and collaboration