How to export & import Form Templates in ITIM

IBM Tivoli Identity Manager includes Export and Import data options, which can be used for several setup parameters : policies, groups, operations, roles, services or workflow.

Unfortunately, Forms are not exportable, and one can spend some times to design these forms. But in fact there is a simple solution to export these forms and reimport them in another TIM instance, or copy them for another entity.

Form templates are stored in TIM LDAP directory, in ou=formTemplates, ou=itim, ou=TENANT, o=ORGANIZATION-NAME branch. Therefore, they can be exported with a simple ldapsearch :

FORMSBASE=ou=formTemplates, ou=itim, ou=TENANT, o=ORGANIZATION-NAME
FORMNAME=ITIMexternalPerson
ldapsearch -x -L -h $LDAPHOST -D $BINDDN -w $BINDPW -b "$FORMSBASE" "(erformname=$FORMNAME)" erxml > $FORMNAME.ldif

This generates a LDIF file, which contains the DN and the erxml content, encoded in base64 :

dn: erformname=ITIMexternalPerson,ou=formTemplates,ou=itim,ou=TENANT, o=ORGANIZATION-NAME
erxml:: PHBhZ2U+Cjxib2R5Pgo8dGFiYmVkRm9ybT4KPHRhYiBpbmRleD0iMCIgc2VsZWN0ZWQ9In
 RydWUiPgo8dGl0bGU+PCFbQ0RBVEFbaWlyRlJFWFRQZXJzb25dXT48L3RpdGxlPgo8aW1hZ2UvPgo
 8dXJsPmphdmFzY3JpcHQ6c3dpdGNoVGFicyhkb2N1bWVudC5mb3Jtc1snYm9keSddLDApOzwvdXJs
 Pgo8Zm9ybUVsZW1lbnQgZGlyZWN0aW9uPSJpbmhlcml0IiBuYW1lPSJkYXRhLmVyY3VzdG9tZGlzc
 GxheSIgbGFiZWw9IiRlcmN1c3RvbWRpc3BsYXkiPgo8aW5wdXQgbmFtZT0iZGF0YS5lcmN1c3RvbW
 .../...

Then you have an LDIF file, which contains the XML used to define the form template.

If you want to duplicate this form in another instance (for example from development to test or production), you just have to create a ldif file with :

dn: erformname=ITIMexternalPerson,ou=formTemplates,ou=itim,ou=TENANT,o=ORGANIZATION-NAME
changetype: modify
replace: erxml
erxml:: PHBhZ2U+Cjxib2R5Pgo8dGFiYmVkRm9ybT4KPHRhYiBpbmRleD0iMCIgc2VsZWN0ZWQ9In
 RydWUiPgo8dGl0bGU+PCFbQ0RBVEFbaWlyRlJFWFRQZXJzb25dXT48L3RpdGxlPgo8aW1hZ2UvPgo
 8dXJsPmphdmFzY3JpcHQ6c3dpdGNoVGFicyhkb2N1bWVudC5mb3Jtc1snYm9keSddLDApOzwvdXJs
 Pgo8Zm9ybUVsZW1lbnQgZGlyZWN0aW9uPSJpbmhlcml0IiBuYW1lPSJkYXRhLmVyY3VzdG9tZGlzc
 GxheSIgbGFiZWw9IiRlcmN1c3RvbWRpc3BsYXkiPgo8aW5wdXQgbmFtZT0iZGF0YS5lcmN1c3RvbW
 .../...

You can then import the file with an ldapmodify command :

ldapmodify -c -x -h $LDAPHOST -D $BINDDN -w $BINDPW -f myFormFile.ldif

If you want to copy this form for another entity (based on the same objectclass), you just have to change the DN in your ldif file. For example :

dn: erformname=ITIMInternalPerson,ou=formTemplates,ou=itim,ou=TENANT,o=ORGANIZATION-NAME
changetype: modify
replace: erxml
erxml:: PHBhZ2U+Cjxib2R5Pgo8dGFiYmVkRm9ybT4KPHRhYiBpbmRleD0iMCIgc2VsZWN0ZWQ9In
 RydWUiPgo8dGl0bGU+PCFbQ0RBVEFbaWlyRlJFWFRQZXJzb25dXT48L3RpdGxlPgo8aW1hZ2UvPgo
 8dXJsPmphdmFzY3JpcHQ6c3dpdGNoVGFicyhkb2N1bWVudC5mb3Jtc1snYm9keSddLDApOzwvdXJs
 Pgo8Zm9ybUVsZW1lbnQgZGlyZWN0aW9uPSJpbmhlcml0IiBuYW1lPSJkYXRhLmVyY3VzdG9tZGlzc
 GxheSIgbGFiZWw9IiRlcmN1c3RvbWRpc3BsYXkiPgo8aW5wdXQgbmFtZT0iZGF0YS5lcmN1c3RvbW
 .../...

and run the ldapmodify.

Catégorie