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

Re: openldap backup procedures?

> 	I'm looking to dump my LDAP directory, both for backup and replication/
> migration.  However, when I try to dump:
> /usr/local/sbin/ldbmcat -n /usr/local/data/slapd/id2entry.dbb
> ...and then restore...
> cat dump.ldif | ldapadd  -w foobar -D "cn=Manager, dc=ge, dc=com"
> I get things like:
> adding new entry nxx=515, npa=580, st=OK, co=USA, 
>   dc=mabell-20000912-175552, cn=Manager, dc=ge, dc=com
> ldap_add: No such object
> I'm assuming that the dump needs to have things in order to preserve the
> heirarchy of my data, but isn't.  Any idea how I can dump data in a way
> that is portable and can be stored and restored?

Since you describe using ldbmcat, you must be using version 1.2.x.
However, an analogous answer probably applies to 2.x.

ldbmcat generates an ldif file in database order -- ie. no particular
order.  This means that branches and leaves are often written before
their parents, which is intolerable to ldapadd.

You must use ldif2ldbm to reload a file dumped by ldbmcat.  This also
has the advantage that createtimestamp and modifytimestamp will be
preserved.  It has the disadvantage that minimal checking is performed
during the reload.