# Duplicate files in database

**URL:** <https://forums.plex.tv/t/duplicate-files-in-database/648216>\
**Category:** Plex Media Server\
**Tags:** server-windows\
**Created:** [October 29, 2020, 3:22pm UTC](https://forums.plex.tv/t/duplicate-files-in-database/648216 "2020-10-29T15:22:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xenago](https://avatars.discourse-cdn.com/v4/letter/x/a183cd/32.png) [@xenago](https://forums.plex.tv/u/xenago)\
**Post date:** [October 29, 2020, 3:22pm UTC](https://forums.plex.tv/t/duplicate-files-in-database/648216/1 "2020-10-29T15:22:17Z")

</div>

Server Version#: 1.20.3.3437

Somehow a second server process spawned, which scanned in duplicate file paths for the same items, making Plex behave as though 2 versions existed of every scanned file. Obviously it’s easy to close the 2nd process, but the carnage it created in the library is substantial and that is baffling since it’s extremely basic logic - if a path exists already, don’t add it a second time.

The ‘optimize database’ function does not clear out these duplicates, which would solve issues related to that problem. Can Plex please have logic added to the scanner which prevents duplicate file paths from being added? There is no situation in which an IDENTICAL path should be added twice to the same media item.

To reiterate: a check to the media scanner to prevent a duplicate path being scanned into an item would prevent any issues like this from occurring, and an adjustment to the ‘optimize database’ function to add this (check and remove duplicate paths) would help clean up libraries which are already affected.

---

<div class="post-metadata">

**Author:** ![mguerville](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mguerville/32/225521_2.png) [@mguerville](https://forums.plex.tv/u/mguerville)\
**Post date:** [January 26, 2021, 12:27am UTC](https://forums.plex.tv/t/duplicate-files-in-database/648216/2 "2021-01-26T00:27:27Z")

</div>

Same issue, have not found a solution yet, I delete the library (in Settings \> Manage Libraries), then re-added it and over time (hours) it recreated doubles or triples of everything

I checked my actual files and there’s no duplicates, my id3 tags are clean, it’s just frustrating and I can’t find a solution

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [April 26, 2021, 12:27am UTC](https://forums.plex.tv/t/duplicate-files-in-database/648216/3 "2021-04-26T00:27:35Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
