DBRepair development

That is that DAMN FLAG nagging me.

I see I’m still printing the full path. I FIXED THAT!

There is a --nocommit command line option now to go with History and revert

Would you email me the log file please ?

I’ll fix this now if you have the time for another build ?

Sure I can run another build tonight when I finish my work call. Thanks

Spectacularly boring from my point of view @chuckpa ! :grinning_face:

Ran just an “Automatic” - it was all over in a few seconds and nothing to see here?

It was so fast I was left doubting whether it was actually doing anything! :grinning_face:

2026-09-15 13.25.44 - ============================================================
2026-09-15 13.25.44 - Session start. Tue Sep 15 13:25:44 2026 (ver 0.1999.10)
2026-09-15 13.25.44 - PMS Version = 1.43.4.10903
2026-09-15 13.25.44 - ============================================================
2026-09-15 13.25.44 - Load    - Matched compiled schema for PMS 1.43.4.10903
2026-09-15 13.25.44 - Load    - Loaded:   Main:  <compiled:1.43.4.10903>
2026-09-15 13.25.44 - Load    - Loaded:   Blobs: <compiled:1.43.4.10903>
2026-09-15 13.25.53 - RunSysCmd executing: 'TMPDIR=/tmp osascript -e 'tell app "Plex Media Server" to quit''
2026-09-15 13.25.53 - RunSysCmd: Command exited with status 0
2026-09-15 13.25.54 - Stop - PASS
2026-09-15 13.25.54 - Auto    - START
2026-09-15 13.25.54 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-09-15 13.25.55 - CheckDB - Checking Indexes and FTS tables - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-09-15 13.25.55 - Fragment- Main DB is 0% fragmented
2026-09-15 13.25.55 - CheckDB - Full check complete - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
2026-09-15 13.25.55 - Auto - Check Main DB - PASS
2026-09-15 13.25.55 - CheckDB - Checking basic integrity - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-09-15 13.25.55 - CheckDB - Checking Indexes and FTS tables - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-09-15 13.25.55 - Fragment- Blobs DB is 0% fragmented
2026-09-15 13.25.55 - CheckDB - Full check complete - /Users/stephenh/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.blobs.db
2026-09-15 13.25.55 - Auto - Check Blobs DB - PASS
2026-09-15 13.25.55 - Auto    - COMPLETED - No repair needed
2026-09-15 13.25.55 - RunSysCmd executing: 'TMPDIR=/tmp osascript -e 'tell app "Plex Media Server" to launch''
2026-09-15 13.25.55 - RunSysCmd: Command exited with status 0
2026-09-15 13.25.55 - Start - PASS
2026-09-15 13.25.55 - Auto    - PMS restart confirmed
2026-09-15 13.25.55 - Auto    - COMPLETED SUCCESS
------------------------------------------------------------

Clearly have cleanup

Did you run orphans ?

Notice how it takes longer to start ?

I’m VERY specific about which DB schema set I load.

I have 69 versions to run through against the DB itself

Just did then - it just went back to the menu with no feedback. I guess I was expecting to see “No Orphans” or the like?

Yeah. I forgot that. I did Orphans during dinner haha

Ha Ha! I have my doubts it actually did anything as there is nothing in the log to indicate it did an “orphans” run … ???

You like challenging me, Don’t you ?!?!?! :stuck_out_tongue:

lol

In general, what do you think so far ?

Check , repair, and doing it manually ?

Am I making (good??) progress ?

@ChuckPa

You are making great progress, it’s VERY fast.
Still waiting for the cute Application Icon of course …

I’ve run through most of the menu options with all results being “nothing to see here , move along” so I’m probably not a very good test case.

I’d look at “Orphans” again though when you are not eating dinner, no onscreen feedback and nothing in the logs - may as well call the command “Ghost”. :rofl:

@ozzymo

I think I know what the typo is.
May I have your db’s (PM me a download link) so I can set a breakpoint to confirm it ?

Yep, standby …

Sure can you tell me exactly which files you need. I tried to upload my log to you 44kb but it’s not letting it go through

@ozzymo

PM sent

ALL

I found the problem @ozzymo encountered.

It’s definitely weird and not something Plex checks for.
I, on the other hand, do check. That’s what surfaced it.

I know what to do.
I’ll start working on it tomorrow.

I know, another delay, but this is well worth it.

Problem appears resolved.

Ozzymo confirmed working for him. Waiting for additional confirmation.

DBRepair v0.1999.10

DBRepair v0.1999.10 is now available for your consideration & testing.

It will expire in 14 days from today.

If there are no bug, failures, or anything missing, and the documentation is completed by then, we’ll advance to first production release.

Each ZIP file now contains an initial Proof-of-Concept for documentation in both .md (Markdown) and HTML form. It’s mostly complete but very rough in styling. There will be a Wiki on GitHub when this is completed.

Release Notes:

DBRepair Release Notes

v0.1999.10

  * Automatic       - "Auto" functions again.
                      Will stop PMS if running and restart after. 
                      Will automatically revert itself if any failures during process.
                      Automatic can be reverted through history. 

  * Import          - "Import" functions again.
                      Import watch history from other DB. 
                      Imports correctly without need to deduplicate itself.
                      Import can be reverted through history.

  * Replace         - "Replace" functions again. 
                      Finds the PMS-generated DB backups and presents you with the
                      list to choose from.  Once selected, DBRepair validates the DB choice
                      and then makes them the active DBs.    
                      Replace can be reverted through history if not to your liking.

  * Orphans         - DBRepair will now point to the specific media item(s) which are orphaned in 
                      the DB.  ( minor damage found and possible to track to the specific item(s). )

                      This will allow you to effect the remedy which DBRepair can't
                      by using Plex Dance procedure or reloading missing media files.

                      **Example:**

                      NOTICE: 3 track/album/episode record(s) aren't connected to their parent.
                          Playback is unaffected, but 'Scan Files' can't fix this.
                          Recommend 'Plex Dance' or manual file restoration.

                      Library 'Music': 2 item(s) affected
                        - Album: "Battle Ground: The Dresden Files, Book 17" (id 24965)
                        - Track: "Battle Ground: The Dresden Files, Book 17" (id 24966)
                      Library 'TV Shows': 1 item(s) affected
                        - Episode: "Premiere" (id 1125)

  * History         - Cleaned up History track tagging (UPPER/lower case)

  * Version Support - Schema support now expanded to all 69 builds from 1.40.0
                      through 1.43.4 except four redacted (1.41.5 - 1.41.8) builds.

                      DBRepair prefers exact PMS version match when possible but won't fail without it.
                      DBRepair will use your backups as authoritative sources instead. 
                      In this situation,  DBRepair won't be able to detect missing tables until 
                      it has the pure schema added (contact ChuckPa for these).

                      It's still more intelligent than DBRepair.sh but not fully
                      capable.

                      "Blind mode" (no database schema references available) is being 
                      completed & tested.   It will be finalized in upcoming release.

  * Cleanup         - Significant cleanup of the console output as DBRepair nears production status. 

  * Other           - Numerous other internal improvements as my code writing gets better >:-))
  


Binaries for your consideration

Please let me know how it works for you, “pro” or “con” or “meh”

Watching this thread is more entertaining than TV :grin:

Does DBRepair delete orphaned entries in the DB? E.g. if I have a movie library in Plex, but I deleted the files, will it clear it up or am I misunderstanding?

@RealJerk

I do not delete orphans.

I point them out to you so you can correct them.
In most cases it’s a Plex Dance but equally can be missing media.
Either way, I thought you , as admin, should know of a disconnect

That’s great, thanks for editing the release notes to explain it