Difference between revisions of "Backup and restore 389-DS database"

From Notes_Wiki
(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...")
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<yambe:breadcrumb>389-DS|389-DS</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[LDAP servers]] > [[389-DS]] > [[Backup and restore 389-DS database]]
=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:
389-console provides graphical way of backup and restore of 389-DS database.  For command-line based backup use following information:
Line 18: Line 17:




==Script for taking 389-DS backup via rsnapshot==
=Script for taking 389-DS backup via rsnapshot=


To take 389-ds backup via rsnapshot use:
To take 389-ds backup via rsnapshot use:
Line 35: Line 34:
Then in /etc/rsnapshot.conf use lines similar to:
Then in /etc/rsnapshot.conf use lines similar to:
<pre>
<pre>
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_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/
backup          /vz/private/1100/root/database-backup/                                                  ldap.sbarjatiya.com/
</pre>
</pre>
Line 41: Line 40:
In case of non-container backup we can use:
In case of non-container backup we can use:
<pre>
<pre>
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_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/
backup          root@192.168.1.100:/root/database-backup/                                                  ldap.purpletalk.com/
</pre>
</pre>




<yambe:breadcrumb>389-DS|389-DS</yambe:breadcrumb>
 
 
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[LDAP servers]] > [[389-DS]] > [[Backup and restore 389-DS database]]

Latest revision as of 15:25, 13 March 2022

Home > CentOS > CentOS 6.x > LDAP servers > 389-DS > 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/



Home > CentOS > CentOS 6.x > LDAP servers > 389-DS > Backup and restore 389-DS database