# 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:** 20\
**Page:** 39

<div class="post-metadata">

**Author:** ![charlie2alpha](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/charlie2alpha/32/281791_2.png) [@charlie2alpha](https://forums.plex.tv/u/charlie2alpha)\
**Post date:** [October 20, 2025, 7:25am UTC](https://forums.plex.tv/t/dbrepair-development/822684/829 "2025-10-20T07:25:44Z")

</div>

It’s not necessarily available inside a docker container and lots of users are using those.

---

<div class="post-metadata">

**Author:** ![JCHH](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jchh/32/84326_2.png) [@JCHH](https://forums.plex.tv/u/JCHH)\
**Post date:** [October 20, 2025, 10:23am UTC](https://forums.plex.tv/t/dbrepair-development/822684/830 "2025-10-20T10:23:51Z")

</div>

Agreed.

So the 2 options could be:

- **Auto** (as now, without deflate)
- **Deflate then Auto** (but checking if necessary first then confirming)

?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [October 21, 2025, 2:44am UTC](https://forums.plex.tv/t/dbrepair-development/822684/832 "2025-10-21T02:44:51Z")

</div>

### ALL:

DBRepair v1.12.00 is now available for your consideration

[https://github.com/ChuckPa/DBRepair/releases/tag/v1.12.00](https://github.com/ChuckPa/DBRepair/releases/tag/v1.12.00)

Please be certain to see the Release Notes about process performance.

Sample behavior:

```auto
Check and Deflate started.

Checking the PMS databases
Check complete. PMS main database is OK.
Check complete. PMS blobs database is OK.

Backup current databases with '-BACKUP-2025-10-20_23.33.28' timestamp.
Starting Deflate (Part 1 of 2 - Repair database table)
  This should take approx 1 minutes but is I/O speed dependent

PMS main database successfully repaired.
Starting Deflate (Part 2 of 2 - Reduce size)
PMS main database size reduced.
Verifying PMS main database.
Verification complete. PMS main database is OK.
PMS main database reduced from 115 MB to 115 MB
Saving current main database with '-BLOATED-2025-10-20_23.33.28'
Making deflated database active
PMS main database deflate completed.
Deflate successful.

```

---

<div class="post-metadata">

**Author:** ![JCHH](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jchh/32/84326_2.png) [@JCHH](https://forums.plex.tv/u/JCHH)\
**Post date:** [October 21, 2025, 7:42am UTC](https://forums.plex.tv/t/dbrepair-development/822684/833 "2025-10-21T07:42:53Z")

</div>

Hi @ChuckPa

> This should take approx 1 minutes but is I/O speed dependent

Is this calculated based on size of Db and system Plex is running on?

cheers.

---

<div class="post-metadata">

**Author:** ![nibbles](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nibbles/32/150497_2.png) [@nibbles](https://forums.plex.tv/u/nibbles)\
**Post date:** [October 21, 2025, 8:47am UTC](https://forums.plex.tv/t/dbrepair-development/822684/834 "2025-10-21T08:47:29Z")

</div>

@ChuckPa I tried out the 1.12.00 and found no problems here.  
Thanks.

> [@JCHH](#):
>
> Is this calculated based on size of Db and system Plex is running on?

The code shows it to be approximated as (DBSize / 2).

---

<div class="post-metadata">

**Author:** ![Fluamsler](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/fluamsler/32/163641_2.png) [@Fluamsler](https://forums.plex.tv/u/Fluamsler)\
**Post date:** [October 21, 2025, 10:55am UTC](https://forums.plex.tv/t/dbrepair-development/822684/835 "2025-10-21T10:55:11Z")

</div>

I need advice for a script on Synology:  
ChuckPa mentioned on the GitHub page the “all in one” run with this command:

`#!/bin/bash`

_Go to the PlexMediaServer shared folder_

`cd /var/packages/PlexMediaServer/shares/PlexMediaServer`

_Run classic Stop PMS, Automatic optimization/repair, Start PMS, and exit sequence_

`sudo ./DBRepair.sh stop auto start exit``

I run this script on the scheduled task weekly as user as root. So far so good 😀

.

Now I added the `update` command to the script:

`#!/bin/bash`

Go to the PlexMediaServer shared folder

`cd /var/packages/PlexMediaServer/shares/PlexMediaServer`

Stop PMS, Check for updates, Start PMS and exit sequence

`sudo ./DBRepair.sh stop update start exit`

Unfortunately the script says “last modifed on August 2025” so I doubt that it has been updated. Did I forget something here?  
Please keep in mind I have nearly zero coding knowledge and only opened Port 22 for installing this tool (before I never used it).

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [October 21, 2025, 4:22pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/836 "2025-10-21T16:22:45Z")

</div>

ALL:

1. The estimate is based on testing using an ARMv8 CPU with SATA SSD  
(older QNAP TS-128A machine).

2. It seems I messed up the README file. There is no reference to Deflate (option 23) in the release. I will be re-releasing v1.12.00 (no need for v1.12.01)

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [October 21, 2025, 4:25pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/837 "2025-10-21T16:25:51Z")

</div>

> [@Fluamsler](#):
>
> sudo ./DBRepair.sh stop update start exit

I would make two runs:

1. Stop Update Start Exit
2. Now perform your normal work.

Update does properly restart on most machines but not all.  
I therefore recommend being safe about it.  
–OR–  
Manually download and install the update yourself. in the PlexMediaServer shared folder (best option)

---

<div class="post-metadata">

**Author:** ![FordGuy61](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@FordGuy61](https://forums.plex.tv/u/FordGuy61)\
**Post date:** [October 21, 2025, 5:53pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/838 "2025-10-21T17:53:22Z")

</div>

@Fluamsler

I created a separate Scheduled Task in DSM to download the latest version. I run it manually when a new version of DBRepair is released.

It uses wget to download from GitHub. Run the scheduled task as root.

Enable notifications in DSM to receive an e-mail when a task completes. Synology Control Panel → Notification → Email tab → Email.

Edit / Note: I do not receive notifications via my Synology Account for this task (either e-mail or push). I have to add my gmail account in `Sender email` in the Email section. This might be user error, but I cannot find a way to have notifications via my Syno account.

```auto
#!/bin/bash

# cd to DSM 7.x Plex Data Directory
cd /var/packages/PlexMediaServer/shares/PlexMediaServer

# Download latest version. This overwrites any existing version.  
wget -O DBRepair.sh https://github.com/ChuckPa/DBRepair/releases/latest/download/DBRepair.sh

# Make it executable
chmod a+x DBRepair.sh

```

  

> **body of e-mail notification when task completes**
>
> ```auto
> Task Scheduler has completed a scheduled task.
> 
> Task: DBRepair Download
> Start time: Tue, 21 Oct 2025 12:55:24 -0500
> Stop time: Tue, 21 Oct 2025 12:55:25 -0500
> Current status: 0 (Normal)
> Standard output/error:
> 
> --2025-10-21 12:55:24-- https://github.com/ChuckPa/DBRepair/releases/latest/download/DBRepair.sh
> Resolving github.com... 140.82.114.3
> Connecting to [github.com](http://github.com/)|140.82.114.3|:443... connected.
> HTTP request sent, awaiting response... 302 Found
> Location: https://github.com/ChuckPa/DBRepair/releases/download/v1.12.00/DBRepair.sh [following]
> --2025-10-21 12:55:24-- https://github.com/ChuckPa/DBRepair/releases/download/v1.12.00/DBRepair.sh
> Reusing existing connection to [github.com:443](http://github.com:443/).
> HTTP request sent, awaiting response... 302 Found
> Location: https://release-assets.githubusercontent.com/github-production-release-asset/531714386/303bda72-9708-4609-9375-3a516fe80434?sp=r&sv=2018-11-09&sr=b&spr=https&se=2025-10-21T18%3A50%3A57Z&rscd=attachment%3B+filename%3DDBRepair.sh&rsct=application%2Foctet-stream&skoid=96c2d410-5711-43a1-aedd-ab1947aa7ab0&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skt=2025-10-21T17%3A50%3A24Z&ske=2025-10-21T18%3A50%3A57Z&sks=b&skv=2018-11-09&sig=b6NHswyF8UyQtwO8tZo%2F9SVrvoifm%2BbtXlAvfHK9yIk%3D&jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmVsZWFzZS1hc3NldHMuZ2l0aHVidXNlcmNvbnRlbnQuY29tIiwia2V5Ijoia2V5MSIsImV4cCI6MTc2MTA2OTYyNCwibmJmIjoxNzYxMDY5MzI0LCJwYXRoIjoicmVsZWFzZWFzc2V0cHJvZHVjdGlvbi5ibG9iLmNvcmUud2luZG93cy5uZXQifQ.OkTRwRqz581ijGBt8vZLJT3DFhz1LY82uXV3UBFaHk4&response-content-disposition=attachment%3B%20filename%3DDBRepair.sh&response-content-type=application%2Foctet-stream [following]
> --2025-10-21 12:55:24-- https://release-assets.githubusercontent.com/github-production-release-asset/531714386/303bda72-9708-4609-9375-3a516fe80434?sp=r&sv=2018-11-09&sr=b&spr=https&se=2025-10-21T18%3A50%3A57Z&rscd=attachment%3B+filename%3DDBRepair.sh&rsct=application%2Foctet-stream&skoid=96c2d410-5711-43a1-aedd-ab1947aa7ab0&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skt=2025-10-21T17%3A50%3A24Z&ske=2025-10-21T18%3A50%3A57Z&sks=b&skv=2018-11-09&sig=b6NHswyF8UyQtwO8tZo%2F9SVrvoifm%2BbtXlAvfHK9yIk%3D&jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmVsZWFzZS1hc3NldHMuZ2l0aHVidXNlcmNvbnRlbnQuY29tIiwia2V5Ijoia2V5MSIsImV4cCI6MTc2MTA2OTYyNCwibmJmIjoxNzYxMDY5MzI0LCJwYXRoIjoicmVsZWFzZWFzc2V0cHJvZHVjdGlvbi5ibG9iLmNvcmUud2luZG93cy5uZXQifQ.OkTRwRqz581ijGBt8vZLJT3DFhz1LY82uXV3UBFaHk4&response-content-disposition=attachment%3B%20filename%3DDBRepair.sh&response-content-type=application%2Foctet-stream
> Resolving release-assets.githubusercontent.com... 185.199.111.133, 185.199.109.133, 185.199.108.133, ...
> Connecting to [release-assets.githubusercontent.com](http://release-assets.githubusercontent.com/)|185.199.111.133|:443... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 81334 (79K) [application/octet-stream]
> Saving to: 'DBRepair.sh'
> 
> 0K .......... .......... .......... .......... .......... 62% 19.2M 0s
> 50K .......... .......... ......... 100% 87.0M=0.003s
> 
> 2025-10-21 12:55:24 (27.0 MB/s) - 'DBRepair.sh' saved [81334/81334]
> 
> ```

---

<div class="post-metadata">

**Author:** ![nibbles](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nibbles/32/150497_2.png) [@nibbles](https://forums.plex.tv/u/nibbles)\
**Post date:** [October 21, 2025, 6:35pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/839 "2025-10-21T18:35:48Z")

</div>

> [@ChuckPa](#):
>
> I would make two runs:
> 
> 1. Stop Update Start Exit
> 2. Now perform your normal work.

Forgive the simplistic question I’m about to ask 🙂  
It’s just updating a file. Why stop and start PMS?

I was thinking there would be two cron jobs run \>= 10min apart.

1. `sudo ./DBRepair.sh update exit`
2. `sudo ./DBRepair.sh stop auto start exit`

I like what @FordGuy61 mentioned,  
text message, recent commit summaries, link to the project  
in case I’m busy

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [October 21, 2025, 6:58pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/840 "2025-10-21T18:58:46Z")

</div>

@nibbles

Sorry, wrote that wrong.

You’re right.

Start, Update, Exit  
Start , — do your stuff here — , exit

---

<div class="post-metadata">

**Author:** ![Fluamsler](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/fluamsler/32/163641_2.png) [@Fluamsler](https://forums.plex.tv/u/Fluamsler)\
**Post date:** [October 21, 2025, 11:12pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/841 "2025-10-21T23:12:05Z")

</div>

Huge **thanks!** for the script! 😀 I’ve added this to my NAS and let it run a couple of minutes before I start the DBRepair tool.

BTW: I also don’t receive any notification mails from the scheduled task window. The emails from Hyper Backup for both of my backup jobs (offsite backup at 8 PM and my HDD backup at 2 AM) work without any problems. Even if I re-added the credentials to Synology I doubt that we both miss-typed informations so I guess it’s more likely that Synology messed something up here! 😉

@ChuckPa  
Thanks for the hint! You’re right I guess it is better to create two smaller scripts than putting too many commands into one file and risking messing something up. I’ll keep this in mind. 😀

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [October 21, 2025, 11:23pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/842 "2025-10-21T23:23:54Z")

</div>

### ALL:

Fixed a couple mistakes in the documentation & math

v1.12.01 is available for your consideration

---

<div class="post-metadata">

**Author:** ![nibbles](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nibbles/32/150497_2.png) [@nibbles](https://forums.plex.tv/u/nibbles)\
**Post date:** [November 7, 2025, 6:19pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/843 "2025-11-07T18:19:56Z")

</div>

Would someone help me understand what log messages  
EDIT: solved

---

<div class="post-metadata">

**Author:** ![JCHH](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jchh/32/84326_2.png) [@JCHH](https://forums.plex.tv/u/JCHH)\
**Post date:** [November 9, 2025, 10:06pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/844 "2025-11-09T22:06:42Z")

</div>

Re v1.13. What is Binhex?

---

<div class="post-metadata">

**Author:** ![FordGuy61](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@FordGuy61](https://forums.plex.tv/u/FordGuy61)\
**Post date:** [November 9, 2025, 10:09pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/845 "2025-11-09T22:09:50Z")

</div>

> [@JCHH](#):
>
> What is Binhex?

Docker.

```auto
## Hosts currently supported

        1. Apple (MacOS)
        2. ASUSTOR
        3. Docker containers via 'docker exec' command (inside the running container environment)
           - Plex,inc.
           - Linuxserver.io
           - BINHEX
           - HOTIO
           - Podman (libgpod)
        4. FreeBSD (14+)
        5. Linux workstation & server
        6. MacOS
        7. Netgear (OS5 Linux-based systems)
        8. QNAP (QTS & QuTS)
        9. Synology (DSM 6 & DSM 7)
       10. Western Digital (OS5)

```

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [January 24, 2026, 8:53pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/846 "2026-01-24T20:53:37Z")

</div>

## ALL:

DBRepair v1.14.00 is now available for your consideration.

1. Add support for Full-Text Search (FTS v4) index checking
2. Repair FTS4 indexes when damaged

HUGE thanks to @maxfield-allison for his great work.

DO NOT be surprised if it finds FTS errors when you run it.

FTS index errors have been lurking for some time.  
They typically manifest as Collections problems but I won’t be surprised to find they have greater impact in PMS.

> **[Release v1.14.00 - Add check & repair of FTS indexes · ChuckPa/DBRepair](https://github.com/ChuckPa/DBRepair/releases/tag/v1.14.00)**
>
> This release adds support for checking and repairing the Full-Text Search (FTS v4) indexes in the PMS databases.
> The error originally manifested as a "500 - internal server error" when dealing with...

---

<div class="post-metadata">

**Author:** ![dokuro](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dokuro/32/329926_2.png) [@dokuro](https://forums.plex.tv/u/dokuro)\
**Post date:** [January 28, 2026, 11:01pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/847 "2026-01-28T23:01:38Z")

</div>

First time running this updated script and it found bad fts indexes in my db …

```auto
2026-01-28 22.52.04 - Auto - FTS Check: fts4_metadata_titles - FAIL (Error: stepping, database disk image is malformed (11))
2026-01-28 22.52.05 - Auto - FTS Check: fts4_metadata_titles_icu - FAIL (Error: stepping, database disk image is malformed (11))
2026-01-28 22.52.05 - Auto - FTS Check: fts4_tag_titles - FAIL (Error: stepping, database disk image is malformed (11))
2026-01-28 22.52.07 - Auto - FTS Check: fts4_tag_titles_icu - FAIL (Error: stepping, database disk image is malformed (11))
2026-01-28 22.52.07 - Auto - FTS Check (blobs): fts4_metadata_titles - PASS
2026-01-28 22.52.07 - Auto - FTS Check (blobs): fts4_metadata_titles_icu - PASS
2026-01-28 22.52.07 - Auto - FTS Check (blobs): fts4_tag_titles - PASS
2026-01-28 22.52.07 - Auto - FTS Check (blobs): fts4_tag_titles_icu - PASS
2026-01-28 22.52.07 - Auto - FTS Check - FAIL
2026-01-28 22.52.07 - Auto - FTS damaged, attempting rebuild
2026-01-28 22.52.07 - FTSRbld - MakeBackup com.plexapp.plugins.library.db - PASS
2026-01-28 22.52.07 - FTSRbld - MakeBackup com.plexapp.plugins.library.blobs.db - PASS
2026-01-28 22.52.07 - FTSRbld - MakeBackup - PASS
2026-01-28 22.52.07 - FTSRbld - Rebuild: fts4_metadata_titles - PASS
2026-01-28 22.52.09 - FTSRbld - Rebuild: fts4_metadata_titles_icu - PASS
2026-01-28 22.52.13 - FTSRbld - Rebuild: fts4_tag_titles - PASS
2026-01-28 22.52.19 - FTSRbld - Rebuild: fts4_tag_titles_icu - PASS
2026-01-28 22.52.19 - FTSRbld - Rebuild (blobs): fts4_metadata_titles - PASS
2026-01-28 22.52.19 - FTSRbld - Rebuild (blobs): fts4_metadata_titles_icu - PASS
2026-01-28 22.52.19 - FTSRbld - Rebuild (blobs): fts4_tag_titles - PASS
2026-01-28 22.52.19 - FTSRbld - Rebuild (blobs): fts4_tag_titles_icu - PASS
2026-01-28 22.52.19 - FTSRbld - PASS
2026-01-28 22.52.19 - Auto - FTS Rebuild - PASS

```

… never noticed any search problem really, outside of it being a little slow. I wonder if it might be worth putting this index rebuild/repair in some future pms build so everyone’s indexes can be checked.

---

<div class="post-metadata">

**Author:** ![JCHH](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jchh/32/84326_2.png) [@JCHH](https://forums.plex.tv/u/JCHH)\
**Post date:** [January 29, 2026, 11:12am UTC](https://forums.plex.tv/t/dbrepair-development/822684/848 "2026-01-29T11:12:16Z")

</div>

same. Never noticed any search problems, but…

```shell
Enter command # -or- command name (4 char min) : 3
 
Checking the PMS databases
Check complete. PMS main database is OK.
Check complete. PMS blobs database is OK.

Checking FTS (Full-Text Search) indexes
  FTS index 'fts4_metadata_titles' - DAMAGED
    Error: Error: stepping, database disk image is malformed (11)
  FTS index 'fts4_metadata_titles_icu' - DAMAGED
    Error: Error: stepping, database disk image is malformed (11)
  FTS index 'fts4_tag_titles' - DAMAGED
    Error: Error: stepping, database disk image is malformed (11)
  FTS index 'fts4_tag_titles_icu' - DAMAGED
    Error: Error: stepping, database disk image is malformed (11)
  FTS index 'fts4_metadata_titles' (blobs) - OK
  FTS index 'fts4_metadata_titles_icu' (blobs) - OK
  FTS index 'fts4_tag_titles' (blobs) - OK
  FTS index 'fts4_tag_titles_icu' (blobs) - OK
FTS integrity check complete. One or more FTS indexes are DAMAGED.
Use 'reindex' command (option 6) or 'automatic' (option 2) to rebuild.

NOTE: FTS indexes are damaged but main database structure is OK.
      Use 'reindex' (option 6) or 'automatic' (option 2) to rebuild.

```

---

<div class="post-metadata">

**Author:** ![Yaracuy](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/yaracuy/32/313162_2.png) [@Yaracuy](https://forums.plex.tv/u/Yaracuy)\
**Post date:** [January 29, 2026, 12:25pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/849 "2026-01-29T12:25:44Z")

</div>

Thanks, Chuck.

Is the PowerShell script (Windows) also updated with this latest feature?

[Previous page](https://forums.plex.tv/t/dbrepair-development/822684.md?page=38)

[Next page](https://forums.plex.tv/t/dbrepair-development/822684.md?page=40)
