reformat database