Copy LDAP to Another Server

Copy LDAP to Another Server

Copy LDAP to Another Server

In this scenario, we are going to copy our primary ldap database to our secondary LDAP server and re-apply/update with a more current version. Here’s the basic process:

login on your primary LDAP server, and su to root

LDAP database copy: login on your primary LDAP server, and su to root

from here change to the /tmp directory where we manipulate the LDAP database

LDAP database copy: change to the /tmp directory where we manipulate the LDAP database

from here do a dump of the ldap database

LDAP database copy: do a dump of the ldap database

perfect, now from here we are going to login to our 2nd ldap server

LDAP database copy: perfect, now from here we are going to login to our 2nd ldap server

cd /tmp

LDAP database copy: cd /tmp

now we sftp to our primary LDAP server

LDAP database copy: we sftp to our primary LDAP server

you should be greeted with the following:

LDAP database copy: you should be greeted with the following

change to the /tmp directory

LDAP database copy: change to the /tmp directory

this next command downloads the LDAP database from the original LDAP server

LDAP database copy: this next command downloads the LDAP database from the original LDAP server

done, here’s what the download should have looked like

LDAP database copy: done, here’s what the download should have looked like

now exit from sftp

LDAP database copy: exit from sftp

stop the LDAP service

LDAP database copy: stop the LDAP service

from here remove the present info/database

LDAP database copy: remove the present info/database

start the LDAP service with an empty database

LDAP database copy: start the LDAP service with an empty database

from here add the file to re-create the database

LDAP database copy: add the file to re-create the database

type in your LDAP admin password

LDAP database copy: type in your LDAP admin password

you should see something like this:

LDAP database copy: you should see something like this

obviously you will get the error that it cannot update your admin password, because that would break LDAP.

let’s re-dump the database to make sure all is well

LDAP database copy: let’s re-dump the database to make sure all is well

now vi the ldapdb

LDAP database copy: vi the ldapdb

cool, we can see our most recent entry John Smith is in there.

LDAP database copy: cool, we can see our most recent entry John Smith is in there.

done! we made a copy of LDAP, and moved it to another server.

Hosted Linux Servers at www.zwiegnet.com/go

Related guides: LDAP Replication CentOS 6 | Configure LDAP Server on CentOS 6

Leave a Reply

Your email address will not be published. Required fields are marked *