Backup and Restore Process
Slapcat maindb and changedb (if delta-syncrepl is used)
For a single DB
/opt/symas/sbin/slapcat -f /opt/symas/etc/openldap/slapd.conf -l /tmp/mydb_export.ldif
For multiple DBs
/opt/symas/sbin/slapcat -f /opt/symas/etc/openldap/slapd.conf -b <suffix> -l /tmp/mydb_<suffix>_export.ldif
-b allows DB to be selected by name
-n # can be used to specify DB by number
Use one or the other; not both
If -b or -n # is used to specify DB in slapcat, it must also be used in slapadd
If changedb files is deleted, run a write op against the DB to reinitialize it before proceeding
Zip and scp ldif files to other masters/slaves
Stop solserver on other masters/slaves
Removed main db files, log files and changedb files (if delta-sycnrepl is used)
For Windows Server - Manual Log File Purge:
- Stop the test LDAP database.
- Get the full path to the directory that contains all of the test database files.
- Open a Windows command prompt.
- Change directories to the symas-openldap program directory (cd “C:Files (x86)-openldap”)
- Enter and run the following command:
db_archive.exe -h <path to test database directory> -d
- When this completes, check the available space on the C: drive.
For Windows Server - Automatic Log File Purge:
- Browse to the folder on your C: drive that contains your test database files
- Locate the file named DB_CONFIG
- Open the file in Notepad or Wordpad
- Search for a line that contains: “set_flags DB_LOG_AUTOREMOVE”
- If the line starts with a hash mark (#) the setting is disabled. To enable, remove the hash mark
- If there are no lines that contain “set_flags DB_LOG_AUTOREMOVE”, add a line with this text anywhere below the line that starts with
"set_cachesize"
- Save the DB_CONFIG file
- Restart the LDAP service to put the change in to effect
NOTE: Slapadd maindb and changedb files (if delta-syncrepl is used)
For single DB
/opt/symas/sbin/slapadd -q -f /opt/symas/etc/openldap/slapd.conf -l /tmp/mydb_export.ldif
For multiple DBs
/opt/symas/sbin/slapadd -q -f /opt/symas/etc/openldap/slapd.conf -b <suffix> -l /tmp/mydb_<suffix>_export.ldif
- -b allows DB to be selected by name
- -n # can be used to specify DB by number
- If -n # was used in slapcat to specify a db, it must also be included in slapadd command
- The changedb ldif only gets imported to master servers; not slaves
NOTE: Process looks for directories identified in slapd.conf. Modify the above commands if different/additional slapd.conf files are identified
NOTE: Changedb is the accesslog databased used by delta-syncrepl on the masters. It is not configured on the slaves.