1. Assume that you have defined the contractorAddress attribute, create an LDIF file called contractorAddress-attr.ldif with the following content:
    dn: cn=schema 
    changetype: modify 
    
    add: attributeTypes attributeTypes: ( contractor-OID NAME 'contractorAddress' 
      SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 
      SINGLE-VALUE 
      USAGE userApplications 
      X-ORIGIN 'user defined' 
      X-SCHEMA-FILE ’98-custom-schema.ldif’ ) 
      X-ORIGINS ’user defined’ 
      X-SCHEMA-FILE ’98-custom-schema.ldif’ )
  2. Add the attribute using ldapmodify.
    $ bin/ldapmodify --filename contractorAddress-attr.ldif
  3. Next, create an LDIF file to modify the contractor objectclass to allow this attribute. When doing this, you are just re-adding the updated objectClass and the Directory Server will handle the proper replacement of the existing object class with the new one. Create a file called contractor-oc.ldif. Make sure that the lines are not wrapped, the objectClasses line should be one continuous line.
    dn:cn=schema 
    changetype: modify 
    add: objectClasses 
    objectClasses: ( contractor-OID NAME ’contractor’ 
      DESC ’Contractor status information 
      SUP top 
      AUXILIARY MAY ( contractorStatus $ contractorAgency $ contractorAddress ) 
      X-ORIGIN ’Directory Server Example’ 
      X-SCHEMA-FILE ’98-custom-schema.ldif’ )
  4. Update the objectClass using ldapmodify as follows:
    $ bin/ldapmodify --filename contractor-oc.ldif
  5. These schema changes will be replicated to all servers in the replication topology. Verify the change by looking at the config/schema/98-custom-schema.ldif file on the other servers in the replication topology to ensure that the changes are present.
  6. If you need to add an index for this attribute, you can do so by using the dsconfig command-line utility. You will need to do this on each server in your topology unless you have server configuration groups set up. See Configuring Server Groups for more information.
    $ bin/dsconfig create-local-db-index --backend-name userRoot \ 
      --index-name contractorAddress --set index-type:equality
  7. Rebuild the index online. This will not affect other indexes or entries since there is no currently existing data for this attribute on any entry.
    $ bin/rebuild-index --baseDN dc=example,dc=com --index contractorAddress