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

RE: backing up: slapcat vs. ldapsearch vs. db_checkpoint



> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Micah Anderson

> We used to have a back-ldbm backend, so we were nightly doing a
> ldapsearch like the following to backup our data into an ldif format
> that we could then import via slapadd (we have tested it, and
> it works):

> ldapsearch -x -LLL -z 0 -D "$dn" -w "$pass" -b "$basedn" '*' > \
> "$backupdir/ldap.ldif"

Yes this works, but misses any operational attributes (such as
modifyTimeStamp, etc.). You can add "+" to the list of attributes to get all
of those, then you would really have a complete backup.

> Now that we have converted to back-dbd I see that we have some
> additional options for backing up our data before us and I am trying
> to evaluate if we should be changing what we are doing to achieve
> greater speed, higher redundancy or more reliable data backups.

> What we are doing now with ldapsearch works, and when using back-ldbm
> was the only option without taking slapd down. But now that we have
> back-dbd we can do a slapcat, but I am not sure I know why we would
> need to when ldapsearch works. Same question goes for using the
> sleepycat backup methods, are there advantages that make backing
> things up this way desirable? What are the advantages/disadvantages to
> using db_checkpoint (and then backing up the latest logfile) over
> using slapcat over ldapsearch?

> In the FAQ-O-Matic I see how you can do each, but I have not found a
> comparision of why you might do each, I will summarize people's
> responses to this and add it to the FAQ.

The old ldapsearch command is fairly inefficient, and slapcat is much faster
when you are able to use it. The ldapsearch in OpenLDAP 2.2 is as fast as
slapcat, minus any network latency. If you're still using back-ldbm, then
ldapsearch is the most convenient option; otherwise the choice is totally
arbitrary.

Using the raw BDB utilities gives you faster restore, particularly when you
have lots of indexes built. However, you have to work with multiple *.bdb
files instead of a single LDIF file; this may be an OK option using GNUtar,
which handles sparse files correctly.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support