cyverse-austria / ansible-ldap

openldap
0 stars 0 forks source link

TODO #1

Open mb-wali opened 10 months ago

mb-wali commented 10 months ago

dump

sudo systemctl stop slapd

# Export the LDAP data
sudo slapcat -l backup.ldif

# Backup the OpenLDAP database files
sudo cp -r /var/lib/ldap/ /path/to/backup/location

restore

# Restore the OpenLDAP database
sudo rm -r /var/lib/ldap/*
sudo cp -r /path/to/backup/location/ldap/* /var/lib/ldap/
sudo chown -R openldap:openldap /var/lib/ldap/

# Import LDIF data
sudo slapadd -l backup.ldif
tufranz commented 8 months ago

dump

A systemctl stop slapd is not needed for slapcat.

restore

The slapd has to be stopped.

conclusion

When installing the dn_suffix should be the same like the dumped ldap-database. (Otherwise the new suffix has to be created and the wrong one should be deleted.)

mb-wali commented 8 months ago

sumup

Pleas do the followings: @tufranz

folowup @mb-wali

tufranz commented 8 months ago

backup ldap-server and restore to a new one

backup (e.g. host: ldap01.cyverse.at)

on ldap01.cyverse.at:

slapcat -l backup.ldif

copy the dump

copy the dump from ldap01.cyverse.at to the new ldapserver (eg.. qa-openldap.cyverse.at).

restore ( eg.. host: qa-openldap.cyverse.at)

on qa-openldap.cyverse.at:

systemctl stop slapd.service
cd /var/lib/
mv ldap/ ldap.$(date +%Y%m%d)
mkdir ldap
slapadd -f /etc/ldap/slapd.conf -l ~/backup.ldif
chown -R openldap:openldap ldap
systemctl start slapd.service

check

to check the restor look at the difference between the backup.ldif and a new created dump (slapcat -l restore.ldif) on qa-openldap.cyverse.at.