Previous Topic: How the DXsyntax Tool Works

Next Topic: ldifdelta Tool—Calculate the Difference Between LDIF Files

ldif2dxc Tool—Convert Schema from LDIF to CA Directory Format

Use the ldif2dxc tool to convert LDAP schema in LDIF format into the CA Directory schema configuration format (.dxc). The tool can also update an existing schema.txt file.

This command has the following format:

ldif2dxc [options] [outfile]
options

Denotes one or more of the following options:

-b badfile

Write bad schema records to the specified file.

-f file

Read input from the specified file.

-m map

Get OIDs from the specified map file.

-M oid_arc

Generate missing OIDs from 'oid_arc'. For example x.y.z. generates x.y.z.0, x.y.z.1, etc. x.y.z.34 generates x.y.z.34, x.y.z.35, etc.

-x dxcFile

Exclude schema that is defined in the specified .dxc file.

-Z schema

Append new schema definitions in DXtools schema file format to the specified file.

outfile

Specifies the name of the file into which the LDIF data will be saved.

-H (or any non-existent option)

Displays usage and option information

Example: Convert the Unique Part of the Schema

You want to convert the schema in the new_schema.ldif file. In this case, you are not interested in the entire external schema, but rather schema unique to the external source. The local directory also typically sources a single DSA schema group file (for example, dxmanager.dxg).

To convert only the schema unique to the external source, you want to instruct the tool to exclude an existing schema file. In addition, you want to instruct the tool not to redefine any internal DSA schema definitions.

Enter the following command:

ldif2dxc -f new_schema.ldif -x dxmanager.dxg new_schema.dxc

Example: Convert with Errors

While converting the schema in the new_schema.ldif file, the tool stops with an error because of schema incompatibility with CA Directory and does not produce any output. The problem may be caused by an unsupported syntax or matching rule, or an error in the published schema. In these cases, you can instruct the tool to write any bad schema to a bad file but continue writing the good schema to your output file. You can inspect the bad file and decide whether it is worthwhile to correct any of the errors (for example, remove an obscure matching rule for substrings), and then rerun the tool until you have what you need.

To run the tool with a bad file, enter the following command:

ldif2dxc -b bad.txt -f new_schema.ldif -x dxmanager.dxg new_schema.dxc

Example: Convert with a Map File

Some LDAP directories publish OIDs as labels rather than dotted decimal strings (for example, xyConfig-oid). These object classes and attributes do not load into the directory. Instead, the tool assigns them temporary OIDs off the CA Directory arc to enable you to load the new schema, but this solution may not be suitable for all directory implementations.

If the dotted decimal form of these object class and attribute OIDs are available, you can create a map file, and instruct the tool to look up these label OIDs in the file and substitute the labels by the dotted decimal OIDs.

The map file is a three-column comma-separated value (CSV) file with the following format, for example:

-------------------------------------
#
# format: objectClass, attributeType, oid
#
# objectClasses
xyConfig-oid,,1.2.3.4
xyAdmin-oid,,1.2.3.5
# attributeTypes
,abstract-oid,1.2.4.5
,aci-oid,1.2.4.6
-------------------------------------

You map a dotted decimal OID to either an object class or an attribute type, but not both.

To run the tool with a map file, enter the following command:

ldif2dxc -b bad.txt -f new_schema.ldif -m map.txt -x dxmanager.dxg new_schema.dxc

Example: Convert with Label OIDs

If there are a large number of "label" OIDs (e.g. xyConfig-oid) in the LDIF schema file it may take a long time to add an entry for everyone in a map file. An alternative is to specify an OID arc that the tool will use in place of any label OID, incrementing it for each label OID it finds.

If your arc is new, you can specify it with a trailing '.', and the tool will start incrementing it from 0. If some OIDs have already been assigned against this OID arc, you can specify the next available OID, and the tool will start incrementing from that one.

To replace the map file in Example 15 with a new OID arc of "1.22.333.444.", on a UNIX system, enter:

ldif2dxc -b bad.txt -f new_schema.ldif -M 1.22.333.444. -x dxmanager.dxg -Z $DXHOME/bin/schema.txt new_schema.dxc

If the tool encountered the OID label xyConfig-oid in new_schema.ldif, it will assign it an OID of 1.22.333.444.0. If it then encountered the OID label abConfig-oid, it will assign it an OID of 1.22.333.444.1, etc.

If twenty OIDs from this arc were assigned, the next available OID would be 1.22.333.444.20. If you were to perform another integration with schema from new_schema2.ldif, to avoid clashing with existing OIDs in the directory, on a UNIX system, enter:

ldif2dxc -b bad.txt -f new_schema2.ldif -M 1.22.333.444.20 -x dxmanager.dxg -Z $DXHOME/bin/schema.txt new_schema2.dxc

If the tool encountered the OID label cdConfig-oid in new_schema2.ldif, it will assign it an OID of 1.22.333.444.20. If it then encountered the OID label efConfig-oid, it will assign it an OID of 1.22.333.444.21, etc.

Example: Convert an OpenLDAP SLAMD Schema

The OpenLDAP SLAMD is a non-standard schema representation

However, ldif2dxc is tolerant of other such schema types:

ldif2dxc -f slamd.openldap.conf -x x500.dxc slamd.openldap.conf.dxc