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

Re: really basic questions about backup and restore



tir, 23.12.2003 kl. 16.28 skrev Craig White:

> EXAMPLES
> To make a text backup of your SLAPD database  and  put  it  in  a  file
> called ldif, give the command:
>      /usr/sbin/slapcat -l ldif
> 
> easy enough...
> but of course, you can't use that to restore your directory because of
> the fields creatorsName: createTimestamp: modifiersName:
> ModifyTimestamp: I can probably do search/replace to clean this up if
> needed.

In fact, using 2.1.x and 'slapadd -l ldif', you can completely restore
your directory - providing your slapd.conf index and database entries
remain the same. You don't have to worry about the internal attributes
that you mention above - just leave them as they are.

> if I simply do an ldapsearch '(objectclass=*)' > file, as long as I can
> do it with say rootdn, I will get the whole db into this file.

Don't use this method unless you have a good reason: i.e. just getting
an ldif for an rDN subtree. You could lose a lot of internal attributes
which are necessary for the database.

>  Are
> either/both ordered well enough to import again into an empty directory?

slapadd is, so is the other, but slapadd is best to reproduce the whole
DIT. Be aware that you cab run into all sorts of problems trying to do
this with a 2.0.x ldif -> 2.1.x, c.

> Is there a better way? Obviously, I am thinking about backing up in a
> nightly cron script.an result in lots of editing/sed or whatever.

With BDB (latest version always) it's sufficient to db_checkpoint the
latest log file and then back that up. You can then rebuild the entire
database from this and whatever other files db_archive (-param) tells
you. Read the SleepyCat docs for more on the db_* utilities.

--Tonni

-- 
mail: billy - at - billy.demon.nl
http://billy.demon.nl