# DBRepair development

**URL:** <https://forums.plex.tv/t/dbrepair-development/822684>\
**Category:** Apps & Creations\
**Created:** [December 14, 2022, 3:57am UTC](https://forums.plex.tv/t/dbrepair-development/822684 "2022-12-14T03:57:23Z")\
**Posts on this page:** 1\
**Showing post:** 1105

<div class="post-metadata">

**Author:** ![d2freak](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/d2freak/32/111000_2.png) [@d2freak](https://forums.plex.tv/u/d2freak)\
**Post date:** [August 27, 2026, 8:37am UTC](https://forums.plex.tv/t/dbrepair-development/822684/1105 "2026-08-27T08:37:06Z")

</div>

I can not do this right now Chuck. I apologize.

However you can see this post from @OttoKerner to see what I’m talking about (orphaned accounts being retained in the database after being removed from Plex)

> [@How to remove orphaned user accounts?](https://forums.plex.tv/t/how-to-remove-orphaned-user-accounts/937658/5):
>
> There should be one table containing all the user names and their individual ID numbers. And there is another table containg all the playback history, containing both a time stamp, the user ID, and the media ID which has been played. You need to cross-reference one with the other, then remove all the lines with the user ID of users who no longer exist from the playback history. The whole will only require basic SQL knowledge. But still, you want to retain a backup of the primary database fil…

He knows how to do it. Perhaps you could collaborate about implementing a cleanup of this in your new program? Thanks for your work.

Edit: the option could say something like “prune orphaned users” and your program could cross check with Plex cloud which users are currently added, and prune the rest (orphaned). This should obviously not be included in the auto mode, but it should be safe in general.

---

_[View the full topic](https://forums.plex.tv/t/dbrepair-development/822684)._
