{{tag>[centos7 iredmail ldif]}} =====iRedMail (OpenLDAP) restore from LDIF===== * Stop slapd: systemctl stop slapd * Check LDAP directory and delete files in directory below, except DB_CONFIG:# find openldap directory grep ^directory /etc/openldap/slapd.conf directory /var/lib/ldap/ # delete files from directory cd /var/lib/ldap/ shopt -s extglob rm -f !(DB_CONFIG) * Start and immediately stop slapd to recreate nessecary files: systemctl start slapd systemctl stop slapd * Make sure OpenLDAP is **NOT** running, then restore from LDIF:slapadd -f /etc/openldap/slapd.conf -l /path/to/backup/backup.ldif * Start slapd:systemctl start slapd * Set correct permissions and restart slapd:chown ldap. /var/lib/ldap//*.bdb systemctl restart slapd * Change passwords for vmail and vmailadmin (see iRedMail.tips file):#cn=vmail,dc=xxx,dc=xxx #cn=vmailadmin,dc=xxx,dc=xxx ldappasswd -x -h localhost -D "cn=Manager,dc=,dc=com" -w -s "cn=vmail,dc=,dc=com" ldappasswd -x -h localhost -D "cn=Manager,dc=,dc=com" -w -s "cn=vmailadmin,dc=,dc=com" * Verify example:ldapsearch -D "cn=Manager,dc=,dc=com" -w password -h localhost -b "dc=,dc=com"