[Opendj] Costomize Schema from Sun DS to OpenDJ

Mark Craig mark.craig at gmail.com
Thu Feb 9 08:33:26 EST 2012


Hello,

If the Sun DS instance has custom schema, you'll need to add the same customizations to the OpenDJ schema before you import the data. See http://opendj.forgerock.org/doc/admin-guide/OpenDJ-Admin-Guide/chap-schema.html for explanations and examples regarding schema.

On Feb 9, 2012, at 1:41 PM, Pankaj Singh wrote:

> Hi all,
> 
> As my client request,Migrate from Sun DS to OpenDJ.There are some custom schema file.I have exported from Sun DS and imported in OpenDJ,Got message successfully imported.But when I tried to search records it is not found.
>  Could you please help me how to import customize schema in OpenDJ while that exported from Sun DS. 
> 

While importing data, by default OpenDJ rejects entries that don't comply with the schema.

$ cat /path/to/unknown-attribute.ldif
dn: dc=com
objectClass: domain
objectClass: top
dc: com

dn: dc=example,dc=com
objectClass: domain
objectClass: top
dc: example

dn: ou=People,dc=example,dc=com
ou: people
description: people
objectclass: organizationalunit

dn: uid=jdoe,ou=People,dc=example,dc=com
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: top
givenName: John
uid: jdoe
cn: John Doe
telephoneNumber: 12345
sn: Doe
mail: jdoe at example.com
description: This entry has an unknown attribute.
unknown-attribute: Not in schema

$ /path/to/OpenDJ/bin/import-ldif --includeBranch dc=example,dc=com --backendID userRoot --ldifFile /path/to/unknown-attribute.ldif 
…
[09/Feb/2012:14:23:43 +0100] category=JEB severity=NOTICE msgID=8847569 msg=Total import time was 0 seconds. Phase one processing completed in 0 seconds, phase two processing completed in 0 seconds
[09/Feb/2012:14:23:43 +0100] category=JEB severity=NOTICE msgID=8847454 msg=Processed 4 entries, imported 2, skipped 1, rejected 1 and migrated 0 in 0 seconds (average rate 15.9/sec)
[09/Feb/2012:14:23:43 +0100] category=JEB severity=NOTICE msgID=8847536 msg=Import LDIF environment close took 0 seconds

The user entry got rejected because it didn't comply with the schema. By the way, import-ldif and the Control Panel both provide ways to keep a list of rejects.

If you start the server, you can try to add the user and see the problem:

$ /path/to/OpenDJ/bin/ldapmodify --port 1389 --bindDN "cn=Directory Manager" --bindPassword password --defaultAdd
dn: uid=jdoe,ou=People,dc=example,dc=com
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: top
givenName: John
uid: jdoe
cn: John Doe
telephoneNumber: 12345
sn: Doe
mail: jdoe at example.com
description: This entry has an unknown attribute.
unknown-attribute: Not in schema

Processing ADD request for uid=jdoe,ou=People,dc=example,dc=com
ADD operation failed
Result Code:  65 (Object Class Violation)
Additional Information:  Entry uid=jdoe,ou=People,dc=example,dc=com violates the Directory Server schema configuration because it includes attribute unknown-attribute which is not allowed by any of the objectclasses defined in that entry


Hope it helps.
Regards,
Mark


> -- 
> Thanks & Regards,
> Pankaj Singh
> +91-9260172293
> _______________________________________________
> OpenDJ mailing list
> OpenDJ at forgerock.org
> https://lists.forgerock.org/mailman/listinfo/opendj

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.forgerock.org/pipermail/opendj/attachments/20120209/58256fc6/attachment.html 


More information about the OpenDJ mailing list