There are  6,000,000 records in my openldap directory, I want to backup the data, but I found that the slapcat isn't work  when the file id2entry.dbb size over 2G, so I export the data by ldapsearch, but after I use slapadd to import the data to the backup server, there are some strange error happened, some records can't be add to the ldap correctly, and the record coundn't be searched by ldapsearch. As the same time, others data can be correctly operated.

Operation system is the redhat linux 9.0.
The verson of openldap is 2.0.27, use ldbm. Because there are too many records so I couldn't upgrade the version of the openldap .

when I use ldapsearch the result is :
#
# filter: (&(uid=abc)(domain=123))
# requesting: ALL
#

# search result
search: 2
result: 0 Success

when i use ldapadd to add the record, it says:

ldap_add: Already exists
ldif_record() = 68


when i use ldapdelete to del it, the result is:

Delete Result: Invalid DN syntax (34)
Additional info: invalid DN
(my dn is right)

I thought mybe the record format is not correct that I exported by ldapsearch and imported by slapadd, because the ldif file lost entryUUID¡¢entryCSN... and so on.

now how can i do? I have tried to  rebuild the entryUUID and run the slapindex to rebuild the index, but failed at least.