changed export sql to add new columns and remove special cases, reexported