Sun ONE logo     Previous      Contents      Index      Next     
Sun ONE Meta-Directory 5.1 Configuration and Administration Guide



Appendix E      Data Conversion

This appendix describes the usage of the tool provided for converting data from the UTC Data Exchange Format (UDEF) to the LDAP Data Interchange Format (LDIF) and from the LDIF to the UDEF.

This appendix contains the following sections:

Need for the tool

Universal Text Connector (UTC) for Meta Directory 5.1 creates an output ldif file for a data flow from Connector View in UDEF. UDEF does not comply with the standard LDIF (RFC 2849). As a result the ldif file created by UTC can not be directly imported by the directory server or it can not be used with ldapmodify to update the LDAP data source. Also the UTC can interpret only UDEF data and it does not understand the standard LDIF data. Therefore the tool is needed for automatically converting the data between these two formats.

Setting the Environment Variables

This section describes the environment settings required for running the tool. It can be run in either the case where Meta-Directory and Directory Server have been installed on the same or separate machines. Set the environment to run the scripts from command line, as follows:

Windows machines:

set path= <NETSITE_ROOT>\lib\nsPerl5.004_04\bin;%path

Solaris machines

For csh:

% setenv PATH <NETSITE_ROOT>/lib/nsPerl5.004_04/bin:$PATH

For ksh/bash:

$ export PATH=<NETSITE_ROOT>/lib/nsPerl5.004_04/bin:$PATH

Replace <NETSITE_ROOT> with the actual location where the Meta-Directory server is installed.

Once the above path is set, you are ready to run the scripts.

usage

There are 2 perl scripts (ldif2udef.pl and udef2ldif.pl) which are shipped along with the Sun ONE Meta-Directory 5.1. After the installation of the Sun ONE Meta-Directory 5.1 these scripts will be available in the <NETSITE_ROOT>/bin/meta50/bin/ directory. You may run the scripts from the same location or copy it to another convenient location.

Converting LDIF data to UDEF data:

The perl script ldif2udef.pl converts LDIF data to UDEF data.

usage:

ldif2udef.pl -i <input file name> -o <output file name>

For example:

ldif2udef.pl -i ldiffile.ldif -o ldiflikefile.ldif

Where <input file name> is the absolute path for the file containing LDIF data to be converted to the UDEF and <output file name> is the absolute path for the file to be created which will contain UDEF data.

Converting UDEF data to LDIF data:

The perl script udef2ldif.pl converts UDEF data to LDIF data.

usage:

udef2ldif.pl -i <input file name> -o <output file name>

For example:

udef2ldif.pl -i ldiflikefile.ldif -o ldiffile.ldif

Where <input file name> is the absolute path for the file containing UDEF data to be converted to the LDIF and <output file name> is the absolute path for the file to be created which will contain LDIF data.

NOTE: It is not necessary to use the nsperl to run above perl scripts. One can also use perl to run these scripts.

Known Issues & Limitations

  • This tool has been written specially keeping in mind the requirements of the Universal Text Connector (UTC) and doesn't provide a support for the LDAP operations other than those supported by UTC. Also, the tool does not support some of the data formats which are not understood by the UTC. Some such non-supported operations and data formats are listed below:
    1. modrdn operation is not supported.
    2. modification of the type add is treated as modification of the type replace by "ldif2udef.pl". warning will be displayed for the same. For Example,
    3. changetype: modify

      add: postaladdress

      postaladdress: 123 Anystreet Sunnyvale, CA 94086

      will be treated as follows:

      changetype: modify

      replace: postaladdress

      postaladdress: 123 Anystreet Sunnyvale, CA 94086

    4. UTC expects value for binary attributes in base64 encoded format. Value in the form of URL for the binary attribute is not supported. Actual base64 encoded value should be provided in the input file.

  • This tool doesn't do the DN mapping. ldif2udef.pl doesn't replace external top level DN with UTC top level DN and udef2ldif.pl also doesn't replace UTC top level DN with the external top level DN. User has to take care of putting proper top level DN for the entries either in input file or output file.
  • For DN containing UTF8 data, UTC expects the DN value to be escaped using \xx notation (RFC 2253). This tool does not do it by itself. User has to take care of putting UTF8 DN in proper format in input file.

Previous      Contents      Index      Next     
Copyright 2003 Sun Microsystems, Inc. All rights reserved.