netinfo2sybase is a csh script that uses the command line program niutil to generate a Sybase SQL script that generates tables, in a database called netinfo, containing the contents of NetInfo's database.  The script makes no assumptions about the contents of the NetInfo database, all the paths become tables and all property values are defined as long variable length strings.  Any non-NeXT properties or paths in the NetInfo database should be preserved and copied by this routine.

The output of this script can be handed directly to isql, eg: 'netinfo2sybase | isql' or redirected into a file for review and/or editing.  This routine takes a long time to complete.  It also makes two passes over the netinfo database since using niutil (or possibly at all) you can not determine the union of all properties of the items in a path without checking them all.

The script's assumption of the local, '.',  domain which can be changed by setting the NIDOMAIN variable at the beginning of the script.

cleanuptables is a Sybase SQL script that rebuilds several of the tables built by netinfo2sybase to use some smarts like make user id's small integers instead of strings, etc.  The script only affects the machines, users, groups, networks, protocols, services and rpcs tables.  Any non-NeXT defined properties in those tables will be lost unless this script is updated to include them.  The script does not define any new types for things like password strings as user-defined types are not usable in a convert statement (which seems totally unreasonable).

This script can be handed directly to isql, eg: 'isql < cleanuptables'.

Both of the above scripts can be executed together by doing:

    ( netinfo2sybase ; cat cleanuptables ) | isql

at the shell.

Please Email me any fixes, optimizations, interesting rules, views, triggers, etc. to include with future releases.

- C.D.Lane (lane@sumex-aim.stanford.edu) 2/4/90