Update DB bacup function, clean up old code