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

backing up and recreating a directory


	I have been working on backing up a directory and trying to restore it (on another machine that
starts with an "empty" directory -- actually, i start with the root entry and a cn=admin entry, so
it's not completely empty).  My course of action is as follows:

machine1# slapcat -l mydir.ldif

machine1# scp mydir.ldif mylogin@machine2:/home/mylogin

then i login to machine2 and use sed to remove the 4 attributes modifyTimestamp, modifiersName,
createTimestamp, and creatorsName wherever they appear in the mydir.ldif file, and i also remove the
cn=admin entry and the root entry, then i do:

machine2# slapadd -l mydir.ldif

which seems to work ok (output reports entries added successfully), but the directory on machine2
does not respond to queries in the way i would expect (and in the way that the directory on machine1

slapcat is the only thing that works as expected -- when i run it on machine2, i do see all the
entries -- however, when i run ldapsearch on machine2 (which i thought should be identical to
slapcat if i don't give any arguments), it gives the following:

machine2# ldapsearch
version: 2

# filter: (objectclass=*)
# requesting: ALL

# search result
search: 2
result: 32 No such object

# numResponses: 1

on machine1 ldapsearch without any arguments returns what i would expect (a dump of the entire
directory, like i get from slapcat):

machine1# ldapsearch
version: 2

# filter: (objectclass=*)
# requesting: ALL

# simons-rock, edu
dn: dc=simons-rock,dc=edu
objectClass: dcObject
objectClass: top
objectClass: domain
dc: simons-rock

# admin, simons-rock, edu
dn: cn=admin,dc=simons-rock,dc=edu
objectClass: organizationalRole
objectClass: simpleSecurityObject
cn: admin
description: LDAP administrator

. <lots more entries here>

I'm not sure exactly what i'm doing wrong, but perhaps someone can tell me where i should be
looking.   Also, if anyone has a better way of doing what i want (dumping the entire contents of a
directory and reloading that to another machine), then i'd love to hear suggestions.

I'm running 2.0.23 on debian woody and i have identical /etc/ldap/slapd.conf files on both machines.

	thanx very much for any assistance,