Printout Header
LEX RSS Feed

LEX Online Manual Content

Importing Directory Data

LEX comes with a feature to import data from a file into the LDAP directory. The import file has to conform to the LDIF specification. LDIF is the LDAP Data Interchange Format and was specified in RFC 2849. This is the LDAP Import dialog:

The LDIF Directory Import

You can initiate the import operation by using the menu option Tools - Directory Import-LDIF. Another, faster way to open the import dialog: Open the context menu directly in the treeview panel (right mouse-click) and use the option Directory Import - LDIF:

Opening the import dialog with the context menu

LEX can not only import LDIF data files into the directory, but also export object list data into LDIF files.


LDIF File Syntax


An LDIF file is an text file and can contain an unlimited number of almost any type of LDAP operation request. There could be requests for creating, deleting, renaming or modifying objects in an LDIF file. The different requests have to be separated by blank lines in the LDIF file.

Examples for LDAP operation entries in an LDIF file:

#Comment: LDIF - Creation of an Organizational Unit
dn: OU=DivisionA,OU=Cerro,DC=cerrotorre,DC=de
changetype: add
objectClass: organizationalUnit

#Comment: LDIF - Object creation with attributes
dn: CN=DepartmentA,OU=Groups,DC=cerrotorre,DC=de
changetype: add
objectClass: group
grouptype: -2147483646
member: Bonatti\, Walter,CN=Users,DC=cerrotorre,DC=de
member: Buhl\, Herrmann,CN=Users,DC=cerrotorre,DC=de
member: Cassin\, Riccardo,CN=Users,DC=cerrotorre,DC=de

#Comment: LDIF - Base64 encoded attributes
dn: CN=Foeckeler\, Philipp,OU=Developpers,O=cerrtorre
changetype: add
objectclass: top
objectClass: person
objectClass: inetorgperson
description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyI
  lvdSBhcmUhICBUaGlzIHZhbHVlIGlzIGJhc2UtNjQ
  tZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRy
  b2wgY2hhcmFjdGVyIGluIGl0IChhIENSKS4NICB

#Comment: LDIF - Including external files as values
dn: CN=Biermann\, Sandra,OU=Developpers,O=cerrtorre
changetype: add
objectclass: top
objectClass: person
objectClass: inetorgperson
jpegphoto:< file://..\photos\sandra.jpg

#Comment: Including external files as values
dn: CN=Biermann\, Sandra,OU=Developpers,O=cerrtorre
changetype: add
objectclass: top
objectClass: person
objectClass: inetorgperson
jpegphoto:< file://..\photos\sandra.jpg

#Comment: LDIF - Changing an attribute value
dn: CN=Biermann\, Sandra,OU=Developpers,O=cerrtorre
changetype: modify
replace: department
department: DEV-KA
-
replace: employeeNumber
employeeNumber: 060970
-

#Comment: LDIF - Deleting an object
dn: CN=DepartmentX,OU=Groups,DC=cerrotorre,DC=de
changetype: delete

#Comment: LDIF - Renaming an object
dn: CN=Kraemer\, Stefanie,OU=Marketing,O=cerrtorre
changetype: modrdn
newrdn: CN=Hofman\, Stefanie
deleteoldrdn: 1

#Comment: LDIF - Moving an object
dn: CN=Hofman\, Stefanie,OU=Marketing,O=cerrtorre
changetype: modrdn
newrdn: CN=Hofman\, Stefanie
newsuperior: OU=Accounting,O=cerrtorre
deleteoldrdn: 0


The Elements of the Import Dialog


The LDIF Directory Import

LDIF Input File

You can select your LDIF input file here. LEX analyse the LDIF content during the load, eliminates comments and unnecessary line feed.

Replace DN ... with ...

During the analyization of the LDIF content, LEX determines the LDAP paths which are present in the import file. You can choose one of these container paths from the drop down list to be replaced with your own choice. This gives you the possibility to quickly export LDIF data from one directory and import it to another.


Normally it would be impossibl to import an LDIF fille into another directory, because the DNs in the file dont match the namespace which is stored in the destination. with this function, all distinguished names from the source directory will be replaced by the distinguished names in the destination directory.

Stop import if errors occur


If this option is activted, teh import process is interrupted when an error occurs. Otherwise, LEX will try to process all LDIF lines in the import file - teh result is shown in the Process Output textbox.

Import

This starts the import process. LEX transfers all the LDAP operations from the LDIF file into the currently connected directory server.

If the import fails and you havt to change something in the LDIF file, just pree Import once again. LEX will re-read the content of the file before re-starting the import process.