Symas OpenLDAP Knowledge Base

Upgrade from BDB/HDB to MDB

The upgrade requires the following steps:

  1. Backup your configuration files.
  2. Make the changes to a copy of your configuration files per the sections below for slapd.conf and cn=config
  3. Stop slapd
  4. Dump the database (slapcat)
  5. Remove the data files from the Openldap date directory 6, If using cn=config, load the updated configuration data
  6. Load the database from the dumped image
  7. Restart slapd

Slapd.conf

  1. Make the following changes to the /opt/symas/etc/openldap/slapd.conf file
        vi /opt/symas/etc/openldap/slapd.conf 

Change references to hdb in the module load and database sections to mdb

    moduleload back_mdb.la
    # moduleload back_bdb.la
    # moduleload back_hdb.la
    
    database mdb
    # database bdb
    # database hdb

In the Database section comment out (#) the following:

    # Cachesize
    # Idlcachesize
    # Checkpoint

Beneath the commented out Checkpoint entry add the following line:

    Maxsize 10485760
    (Equals 10 MB in bytes - adjust as needed) 
  1. Save the slapd.conf file
  2. Restart Solserver/Slapd
        sudo /opt/symas/etc/solserver restart
    Or
        sudo service solserver restart 
    Or
        sudo systemctl restart solserver.service 

Slapd.d

  1. Stop Solserver/Slapd
        sudo /opt/symas/etc/solserver stop 
    Or
        sudo service solserver stop
    Or
        sudo systemctl stop solserver.service 
  1. Export the config database to a text file:
        slapcat -F /opt/symas/etc/openldap/slapd.d -l config.ldif -b
        cn=config
  1. Move the existing config database out of the way:
        mv /opt/symas/etc/openldap/slapd.d{,.old}
  1. Create a new, empty config database:
        mkdir /opt/symas/etc/openldap/slapd.d 
        chown --reference=/opt/symas/etc/openldap/slapd.d.old
        /opt/symas/etc/openldap/slapd.d 
        chmod --reference=/opt/symas/etc/openldap/slapd.d.old
        /opt/symas/etc/openldap/slapd.d 
  1. Edit the exported config.ldif
        vim /opt/symas/etc/openldap/config.ldif
  • Remove the olcSecurity setting (or add olcRootDN and olcRootPW to cn=config section)
  • Modify olcModuleLoad back_bdb.la or back_hdb.la to back_mdb.la
  • Modify olcDatabase={1}BDB or HDB to olcDatabase={1}MDB
  • Remove olcDbCachesize, olcDbIDLcacheSize and olcDbCheckpoint attributes
  • Add olcDbMaxSize 10485760
  1. Save the modified config.ldif
  2. Load the edited LDIF into the new empty database:
        slapadd -F /opt/symas/etc/openldap/slapd.d -l config.ldif 
  1. Start Solserver/Slapd
        sudo /opt/symas/etc/solserver start 
    Or
        sudo service solserver start
    Or
        sudo systemctl start solserver.service