upgrade old db structure to new