Sun logo      Previous      Contents      Index      Next     

Sun ONE Meta-Directory 5.1.1 Administration Guide

Appendix D  
Data Conversion

This appendix describes the use 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:


Overview

Universal Text Connector (UTC) for Meta Directory 5.1.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.8.2\bin;%path

Solaris Machines

For csh:

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

For ksh/bash:

$ export PATH=<NETSITE_ROOT>/lib/nsPerl5.8.2/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.


Using the Scripts

There are two perl scripts (ldif2udef.pl and udef2ldif.pl) which are shipped along with the Meta-Directory 5.1.1. After the installation of the Meta-Directory 5.1.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 and Limitations



Previous      Contents      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.