Use db_alias and collection_name in _get_unique_filename. And delete old file before trying to get a new name