Skip to content

Migrate from OpenLDAP to OpenDJ#


This guide describes migrating the Gluu Server database from OpenLDAP to OpenDJ in Ubuntu or Centos 7 using a migration script. It is intended for existing deployments and is compatible with Gluu Server versions 3.0.0 through


First, copy as inside the Gluu container with the following command:

# cp /install/community-edition-setup/ /install/community-edition-setup/

If setup-properties.last has been deleted, the script will not complete the migration successfully.

Export data to LDIF#

Use the following commands to export data from OpenLDAP to LDIF

# /opt/opendj/bin/ldapsearch -X -Z -D "cn=directory manager,o=gluu" -w <adminPassword> -h localhost -p 1636 -b "o=gluu" "Objectclass=*" > /root/gluu.ldif
# /opt/opendj/bin/ldapsearch -X -Z -D "cn=directory manager,o=gluu" -w <adminPassword> -h localhost -p 1636 -b "o=site" "Objectclass=*" > /root/site.ldif

Replace <adminPassword> with your Gluu admin password.

Stop the servers#

# /etc/init.d/identity stop
# /etc/init.d/oxauth stop
# /etc/init.d/solserver stop

If you have other Gluu Servers, also stop them.

Obtain the migration script#

Get the migration script from the Gluu repo with the following command:

# wget -O /install/community-edition-setup/

Install python-ldap#

CentOS7 users:

# yum install -y python-ldap

Ubuntu Users:

# apt-get install -y python-ldap

Run the migration script:#

# cd /install/community-edition-setup/
# python

If you have custom OpenLDAP schema, convert them to OpenDJ schema files with the script and copy the converted schema file(s) to the /opt/opendj/config/schema directory.

Import data#

First, stop the OpenDJ server:

# /etc/init.d/opendj stop

Then, import the data to OpenDJ:

# /opt/opendj/bin/import-ldif  -b "o=gluu" -n userRoot -l /root/gluu.ldif  -R /root/gluu.ldif.rejects
# /opt/opendj/bin/import-ldif  -b "o=site" -n site -l /root/site.ldif  -R /root/site.ldif.rejects

Start OpenDJ:

# /etc/init.d/opendj start

Re-run the migration script with the -p argument to perform post-migration finalization:

# python -p

Start the servers#

# /etc/init.d/oxauth start
# /etc/init.d/identity start

Try to log in to Gluu UI. If it's working as expected, remove OpenLDAP:


# yum remove symas-openldap-gluu


# apt-get remove symas-openldap-gluu