Backup and restore 389-DS database

From Notes_Wiki
Revision as of 04:29, 10 July 2015 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>389-DS|389-DS</yambe:breadcrumb> =Backup and restore 389-DS database= 389-console provides graphical way of backup and restore of 389-DS database. For comm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>389-DS|389-DS</yambe:breadcrumb>

Backup and restore 389-DS database

389-console provides graphical way of backup and restore of 389-DS database. For command-line based backup use following information:

Backup of 389-DS database:

/usr/lib64/dirsrv/slapd-ldap/db2bak

Backups go into folder /var/lib/dirsrv/slapd-ldap/bak/

To restore backup use:

 ./bak2db /var/lib/dirsrv/slapd-389-ds/bak/2015-07-02-20-56/

Steps contributed by 'Kiran Kollipara' and 'Krati Jain'.


Script for taking 389-DS backup via rsnapshot

To take 389-ds backup via rsnapshot use:

#!/bin/bash

rm -rf /root/database-backup/*
/usr/lib64/dirsrv/slapd-ldap/db2bak
cd /root/database-backup/
mv /var/lib/dirsrv/slapd-ldap/bak/* .

exit 0

This script should not be in /root/database-backup folder.

Then in /etc/rsnapshot.conf use lines similar to:

backup_script   /usr/bin/ssh root@192.168.1.100 "cd /root/database-backup; /root/scripts/database_backup.sh;" > ldap-backup.log 2>&1    ldap.sbarjatiya.com/.ignore1/
backup          /vz/private/1100/root/database-backup/                                                  ldap.sbarjatiya.com/

In case of non-container backup we can use:

backup_script   /usr/bin/ssh root@192.168.1.100 "cd /root/database-backup; /root/scripts/database_backup.sh;" > ldap-backup.log 2>&1    ldap.purpletalk.com/.ignore1/
backup          root@192.168.1.100:/root/database-backup/                                                  ldap.purpletalk.com/


<yambe:breadcrumb>389-DS|389-DS</yambe:breadcrumb>