On 11/02/2020 11:24, Davies, Matt wrote:
Hi there

A colleague of mine recently exported what we believed to be all the data from 
a running apacheds v24 server like so

ldapsearch -h hostname -x -p 10389 -b "dc=org" -s sub "(ObjectClass=)" + > 
backup_060220.ldif

I've then ran through a number of ldif scripts, adding them to a new 
installation to build up the same structure on a different machine, but when I 
try to add the backup file it's failing right at the start

ldapadd -h localhost -p 10389 -x -w [PASSWORD] -D "uid=admin,ou=system"  -f 
/tmp/backup_060220.ldif

adding new entry "dc=DansOrg2,dc=org"
ldap_add: Object class violation (65)
        additional info: OBJECT_CLASS_VIOLATION: failed for MessageType : 
ADD_REQUEST
Message ID : 2
     Add Request :
Entry
     dn[n]: dc=DansOrg2,dc=org

     subschemaSubentry: cn=schema
     createTimestamp: 20191018141712.279Z
     entryUUID: a98fa576-d440-49d5-b336-5f175a5c619e
     entryDN: dc=DansOrg2,dc=org
     nbSubordinates: 2
     entryCSN: 20191018141712.279000Z#000000#001#000000
     entryParentId: 2115906e-3e4d-433e-95f3-3311038027b2
     nbChildren: 2
     creatorsName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system
: ERR_60 Entry dc=DansOrg2,dc=org does not contain a STRUCTURAL ObjectClass


Looking at the backup ldif file, there are numerous entries at the beginning 
that don't have any objectclass defined, here's the first one

# DansOrg2.org
dn: dc=DansOrg2,dc=org
entryCSN: 20191018141712.279000Z#000000#001#000000
nbSubordinates: 2
nbChildren: 2
createTimestamp: 20191018141712.279Z
creatorsName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system
subschemaSubentry: cn=schema
entryDN: dc=DansOrg2,dc=org
entryUUID: a98fa576-d440-49d5-b336-5f175a5c619e
entryParentId: 2115906e-3e4d-433e-95f3-3311038027b2

We're very new to apacheds, so I don’t know if we're creating the backup 
incorrectly, or importing it incorrectly, or a bit of both.

I don't really understand how it could import without an object class.

You specified that you wanted only the operational attributes in your search request ( the '+' at the end of ...-s sub "(ObjectClass=)" +)

Replace it with '*', that should do the trick. Or use '*' and '+'.


Note : you should normally not specify either of them. The operational attributes are internal attributes that are not necessarily needed (except in some corner cases) and teh default is for a search to return all the other attributes (ie you don't have to add the '*')


Hope it helps.

Emmanuel

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org
For additional commands, e-mail: dev-h...@directory.apache.org

Reply via email to