Symas OpenLDAP Knowledge Base

Backup and Restore Process

Slapcat maindb and changedb (if delta-syncrepl is used)

For a single DB

/opt/symas/bin/slapcat -f /opt/symas/etc/openldap/slapd.conf -l /tmp/mydb_export.ldif

For multiple DBs

/opt/symas/bin/slapcat -f /opt/symas/etc/openldap/slapd.conf -b -l /tmp/mydb__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:

  1. Stop the test LDAP database.

  2. Get the full path to the directory that contains all of the test database files.

  3. Open a Windows command prompt.

  4. Change directories to the symas-openldap program directory (cd “C:Files (x86)-openldap”)

  5. Enter and run the following command:

db_archive.exe -h -d

  1. When this completes, check the available space on the C: drive.

For Windows Server - Automatic Log File Purge:

  1. Browse to the folder on your C: drive that contains your test database files

  2. Locate the file named DB_CONFIG

  3. Open the file in Notepad or Wordpad

  4. Search for a line that contains: “set_flags DB_LOG_AUTOREMOVE”

  5. If the line starts with a hash mark (#) the setting is disabled. To enable, remove the hash mark

  6. 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


  1. Save the DB_CONFIG file

  2. Restart the LDAP service to put the change in to effect

Slapadd maindb and changedb files (if delta-syncrepl is used)

For single DB

/opt/symas/bin/slapadd -q -f /opt/symas/etc/openldap/slapd.conf -l /tmp/mydb_export.ldif

For multiple DBs

/opt/symas/bin/slapadd -q -f /opt/symas/etc/openldap/slapd.conf -b -l /tmp/mydb__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.