We have an openLDAP cluster running with two Master(producers) and one consumer. I read the below guides and got a good enough idea about using slapcat/ldapsearch with slapadd/ldapadd to backup & restore the data.
How to Clone an OpenLDAP Database
LDAP backup with slapcat vs. ldapsearch
For me using ldapsearch
with ldapadd
worked on taking a backup and restoring it. However, I ended up changing the entryUUID, contextCSN, create & modifyTimestamp of the entries.
ldapsearch -x -H ldaps://ldap.server.net -D "dc=mycompany,dc=net" -W -b "dc=admin,dc=mycompany,dc=net" -LLL > ldapd-"`date +%Y%m%d`".ldif
ldapadd -x -c -H ldapi:/// -D "dc=admin,dc=mycompany,dc=net" -y "${PASSWORD_FILE}" -f "ldapd-"`date +%Y%m%d`".ldif
I wanted to check if this is a preferred way of doing a backup & restore operations or is there any better practices ?