Reputation: 313
I'm looking for a way to import a ldif file into a apacheDS 2.0 LDAP server. I've seen there was a way with 1.5 and the apacheds-tools.jar but this seems to be removed.
Is there another easy way to get the task done?
Upvotes: 2
Views: 2438
Reputation: 13857
You can use Apache Directory Studio for this.
Just start it, connect to your directory, right-click on "Root DSE" or any other element of the directory and choose "Import" -> "LDFI import".
It is also described here: https://directory.apache.org/apacheds/basic-ug/2.1.1-adding-entries.html
To get the required tools for windows, your can install OpenLDAP (you can get it here: http://www.userbooster.de/en/download/openldap-for-windows.aspx), the client tools contain a ldapmodify.exe (in \OpenLDAP\ClientTools\
).
To use the command line tools on linux you need to install the package ldap-utils (apt-get install ldap-utils).
Then you can do the following:
ldapmodify -h hostname -p 10389 -D "uid=admin,ou=system" -w adminpassword -a -f your-file.ldif
Replace:
hostname with hostname
10389 with the port on which your directory server is running
"uid=admin,ou=system" with the DN of the (probably admin) user you want to use for connecting
10389 with the password of the user
your-file.ldif with the path of your ldif file
For more information, you can have a look at this: https://cwiki.apache.org/confluence/display/DIRxSRVx10/2.2.2.+Command+line+tools
Upvotes: 1