Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to move my ldap server to a newer one. It is currently running on Ubuntu 7.04 server. Is there a way of backing up this server, installing a fresh openldap server on a newer Ubuntu 11.04 server, and restoring the old database to it?

I've tried backing up to a LDIF and restoring it to a new openldap server but I guess it wasn't able to restore the configuration with it.

Any help is appreciated, thanks

share|improve this question
Backing up to LDIF and restoring it should be the simplest way. Quickest way to get your answer would probably be to post exactly what went wrong here. – Philip Reynolds Jun 7 '11 at 22:57
Also make sure you have the same schema. – Mircea Vutcovici Jun 8 '11 at 0:46
Did you do the LDIF dump using ldapsearch or slapcat? Make sure to use slapcat/slapadd for backup/restore. – ptman Jun 8 '11 at 2:27

Your configuration should be in just one file. On 7.04, I believe you had a /etc/ldap/ldap.conf, where your config is. You should be able to move the config file to a new system, and either start openldap with this config file with the -f argument, or you could you also convert to using a dynamic backend, which you probably will not want to do, because of added complexity. Since you were able to dump your contents with slapcat and can import them, the only missing bit is your config file.

share|improve this answer

You cannot migrate using replication, ubuntu 7.1 comes with openldap 2.2 which dont have syncrepl, It only have slurpd. Ubuntu 11 comes with openldap 2.4 which have syncrepl not slurpd. It is possible to migrate online from Openldap 2.2 to Openldap 2.3 & openldap 2.3 to Openldap 2.4, but definitely not Openldap 2.2 to Openldap 2.4.

You need to take backup of your ldap tree & add again.

Take the back up data on old LDAP server system using ldapsearch or slapcat

$ldapsearch -x -LLL -b "dc=yourbase,dc=com" -D "cn=Manager,dc=yourbase,dc=com"  -W  >> mybackup.ldif

or use slapcat, but make sure slapd is stopped before running slapcat.

$slapcat -l /tmp/backup.ldif 

After exporting it to a file,Remove the below attributes from the backup file. If slapcat method is used.

entryUUID|creatorsName|structuralObjectClass|createTimestamp|entryCSN|modifiersName|modifyTimestamp| contextCSN

Import the ldif file using ldapadd command

$slapadd -F /etc/openldap/slapd.d/ -n 0 -l /tmp/backup1.ldif

For cases where third party schema files are being used in ubuntu 7.1 , after copying the schema files to ubuntu11, if any schema violation occurs like OID's used in third party schema files may not be compatible with OpenLDAP versions of ubuntu 11, In which case contact the vendor who have provided the schema files.

share|improve this answer

If you're moving from a 32bit machine to a 64bit machine, OpenLDAP's data may not be compatible. I was not able to find documentation in OpenLDAP's docs for the process of migrating data, but the Zimbra docs might be able to point you in the right direction:

share|improve this answer

This one worked for me:

Get a copy of your data on the old server by running the following command:

ldapsearch -z max -LLL -Wx -D "cn=admin,dc=your,dc=domain" -b "dc=your,dc=base" > save.ldif

Move the file to the new server and import it by running:

ldapmodify -c -Wx -D "cn=admin,dc=your,dc=domain" -a -f save.ldif
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.