Saving before rewriting Tables and Database