Merge pull request #5552 from MrPetovan/bug/5405-prevent-database-erasure-during...