wrote scripts to convert old db to new db