Hey there,
occassionally, people still seem to stumble across this script because it seems it shows up in some search results. Please be aware that I made this script ten years ago, and by now, there is probably a better way to achieve the same result.
Have a nice day!
Here's an example of how I converted the eduperson.schema file to a LDIF formatted schema file that can be used with ldapadd, etc:
I then created a slapd.conf file in /tmp/ldap with the following contents:
Then I converted this configuration over to cn=config format:
Then I exported just that schema file:
In the above example, the eduperson schema gets a weight of 2 because it was the 3rd schema file listed (core, cosine, eduperson). But now the end result is, I permanently have a converted form of the schema file I can use correctly with cn=config. We strip out the operational attributes as we would want those created fresh at import time (whether slapadd or ldapadd)
For an example of using an include statement with a cn=config database to use with slapadd, see my MMR blog post.