This is in Grouper v2.6.1+.
Identify data to sync to SQL
In this case we want users. The single valued attributes are the uid, dn, and a sample expression (date). The multi-valued attributes are: objectClasses and uids. This is the free LDAP browser Apache Directory Studio
Create tables
Note, in this case we want this in a different database from our Grouper database, and its a different database vendor as well (oracle vs postgres). It is already an external system. This is hsql but you can create in any database
CREATE TABLE TESTGROUPER_LDAPSYNC ( THE_DN VARCHAR(200) NOT NULL, CN VARCHAR(200), THE_DATE DATE, CONSTRAINT SYS_PK_86204 PRIMARY KEY (THE_DN) ); CREATE UNIQUE INDEX SYS_IDX_SYS_PK_86204_86205 ON PUBLIC.PUBLIC.TESTGROUPER_LDAPSYNC (THE_DN);
The attribute value table must have these three columns with varchar types (size it for your data). This table is synced from the one and only one ldap-to-sql job
CREATE TABLE PUBLIC.PUBLIC.TESTGROUPER_LDAPSYNC_ATTR ( LDAP_ID VARCHAR(200) NOT NULL, ATTRIBUTE_NAME VARCHAR(200) NOT NULL, ATTRIBUTE_VALUE VARCHAR(200) ); CREATE INDEX TESTGROUPER_LDAPSYNC_ATTR_LDAP_ID_IDX ON PUBLIC.PUBLIC.TESTGROUPER_LDAPSYNC_ATTR (LDAP_ID,ATTRIBUTE_NAME);
Configure the Grouper LDAP to SQL daemon
Note, we already have an LDAP external system to this LDAP
Run the daemon
It took half a second to load 14000 records
dbConnection: grouper, baseDn: ou=People,dc=example,dc=edu, filter: (uid=*), ldapConnection: personLdap, numberOfColumns: 3, searchScope: SUBTREE_SCOPE, tableName: testgrouper_ldapsync, hasMultiValuedTable: true, multiValuedTableName: testgrouper_ldapsync_attr, multiValuedIdColumn: the_dn, multiValuedAttributes: objectClass, uid, extraAttributes: null, dbRows: 0, dbUniqueKeys: 0, dbMultiValuedAttributes: 0, ldapRecords: 2000, ldapMultiValuedAttributes: 12000, deletesCount: 0, deletesMillis: 0, insertsCount: 14000, insertsMillis: 120, updatesCount: 0, updatesMillis: 0, insertsIntendedCount: 24000