fix database restoration when database already exists