Migrate from slapd.conf to cn=configΒΆ


This documentation is generic



the path to the slapd.conf OpenLDAP configuration file


the path to the slapd.d folder that is going to store the future cn=config configuration


the user that owns the slapd process


the group that owns the slapd process

  1. Stop OpenLDAP:

    systemctl stop slapd
  2. Create cn=config directory:

    mkdir <SLAPD_CONF_DIR>
  3. Convert configuration file:

    slaptest -f <SLAPD_CONF> -F <SLAPD_CONF_DIR> -d 256
    # set correct permissions
    find <SLAPD_CONF_DIR> -type d -exec chmod 750 {} \;
    find <SLAPD_CONF_DIR> -type f -exec chmod 640 {} \;
  4. Update the arguments for your OpenLDAP launch command. It can be in any of these paths:

    • the systemd configuration file,

    • /etc/default/slapd,

    • /etc/sysconfig/slapd,

    • /usr/local/openldap/etc/openldap/slapd-cli.conf for OpenLDAP LTB packages

You should replace the argument: -f <SLAPD_CONF> by -F <SLAPD_CONF_DIR>

  1. Start OpenLDAP:

    systemctl slapd start