How to modify schema through LDIF - LDAP

  • 10084796
  • NOVL90813
  • 07-Jul-2003
  • 05-Nov-2003

Archived Content: This information is no longer maintained and is provided 'as is' for your convenience.

Goal

How to modify schema through LDIF - LDAP

Fact

Novell Directory Services 8

Novell eDirectory 8.5 for All Platforms

Novell eDirectory 8.6 for All Platforms

Novell eDirectory 8.7 for All Platforms

Cause

A good way to modify schema is to use an LDIF file through LDAP.  The LDIF format is easy to understand. 

Fix

Below are examples on how to modify a class, modify an attribute, delete a class and delete an attribute.

Modify a Class template ldif file:

dn: cn=schema
changetype: modify
delete: objectClasses
objectClasses: (OID)
-
add: objectClasses
objectClasses: (OID NAME DESC X-NDS flags)

For example: 

version: 1

dn: cn=schema
changetype: modify
delete: objectClasses
objectClasses: (2.5.6.6.6.1.200 NAME 'musician' SUP top MUST (nickname) MAY (recordings $ bands) X-NDS_NOT_CONTAINER '1')
-
add: objectClasses
objectClasses: (2.5.6.6.6.1.200 NAME 'musician' SUP top MUST (nickname) MAY (recordings $ bands) X-NDS_NOT_CONTAINER '0')

This example simply changed the X-NDS_NOT_CONTAINER flag.  In the delete section, the fourth line down could have read:
objectClasses: (2.5.6.6.6.1.200)

Note

The OID can be used in the delete portion.  If the OID is not known, the entire definition must be listed in the delete portion.  Also note the "-" on a line by itself.  This is critical for the operation to work.

Fix

Modify an Attribute template ldif file:

dn: cn=schema
changetype: modify
delete: attributeTypes
attributeTypes: (OID)
-
add: attributeTypes
attributeTypes: (OID NAME DESC SYNTAX, X-NDS FLAGS)

For example:

version: 1

dn: cn=schema
changetype: modify
delete: attributeTypes
attributeTypes: (2.5.6.6.6.1.1 NAME 'nickname' DESC 'Attribute' SYNTAX 2.16.840.1.113719.1.1.5.1.14 X-NDS_NAME 'nickname' X-NDS_PUBLIC_READ '1')
-
add: attributeTypes
attributeTypes: (2.5.6.6.6.1.1 NAME 'nickname' DESC 'Attribute' SYNTAX 2.16.840.1.113719.1.1.5.1.14 X-NDS_NAME 'nickname' X-NDS_PUBLIC_READ '0')

This example simply changed the X-NDS_PUBLIC_READ flag.  In the delete section, the fourth line down could have read:
attributeTypes: (2.5.6.6.6.1.1)

Note

The OID can be used in the delete portion.  If the OID is not known, the entire definition must be listed in the delete portion.  Also note the "-" on a line by itself.  This is critical for the operation to work.

A good way of getting all of the information is to export the schema entry to an LDIF file and then modify what needs to be modified.

Fix

Delete a Class:

version: 1

dn: cn=schema
changetype: modify
delete: objectClasses
objectClasses: (OID NAME 'name')

ie
version: 1

dn: cn=schema
changetype: modify
delete: objectClasses
objectClasses: (2.5.6.6.6.1.200 NAME 'musician')

Note

If classes and attributes are removed, the class must be removed first because it uses the attributes.

If the OID is not defined for this class, the last line in the sample ldif would read:
objectClasses: (musician-oid NAME 'musician')

A good way of getting all of the information is to export the schema entry to an LDIF file and then modify what needs to be modified.

Fix

Delete an Attribute:

version: 1

dn: cn=schema
changetype: modify
delete: attributetypes
attributeTypes: (OID NAME 'name')

ie
version: 1

dn: cn=schema
changetype: modify
delete: attributetypes
attributeTypes: (2.5.6.6.6.1.1 NAME 'nickname')

Note

If the OID is not defined for this attribute, the last line in the sample ldif would read:
attributeTypes: (nickname-oid NAME 'nickname')