I know this is more like a serverfault question than a stackoverflow question, but since serverfault isn’t up yet, here I go:
I’m supposed to move an application from one redhat server to another, and without very good knowledge of the internal workings of the application, how would I move the OpenLDAP database from the one machine to the other, with schemas and all.
What files would I need to copy over? I believe the setup is pretty standard.
The problem with SourceRebels’ answer is that
slapcat(8)does not guarantee that the data is ordered forldapadd(1)/ldapmodify(1).From
man slapcat(from OpenLDAP 2.3) :(FYI: In OpenLDAP 2.4 that section was rephrased and expanded.)
Plus using a tool that uses the backend files to dump the database and then using a tool that loads the ldif through the ldap protocol is not very consistent.
I’d suggest to use a combination of
slapcat(8)/slapadd(8)ORldapsearch(1)/ldapmodify(1). My preference would go to the latter as it does not need shell access to the ldap server or moving files around.For example, dump database from a master server under dc=master,dc=com and load it in a backup server
The
-Wflag above prompts for ldapadmin_masterpassword however since we are redirecting output to a file you wont see the prompt – just an empty line. Go ahead and type your ldapadmin_masterpassword and enter and it will work. First line of your output file will need to be removed (Enter LDAP Password:) before runningldapadd.Last hint,
ldapadd(1)is a hard link toldapmodify(1)with the-a(add) flag turned on.