Simplify database dump and prevent duplicates