# 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:** 25

<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:** [March 1, 2025, 5:29pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/534 "2025-03-01T17:29:46Z")

</div>

I doubt we’ll ever see DBRepair in Plex or shipped with Plex.

@michael_766

When you look at the tool’s menu, you have STOP and START menu options.

A common command line is:

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

```

It’s setup this way so you can perform other actions as you deem appropriate.

---

<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:** [March 1, 2025, 5:39pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/535 "2025-03-01T17:39:44Z")

</div>

## ALL:

I’m contemplating one more pair of commands but not totally convinced how much benefit it provides.

- Backup
- Restore

I’m not convinced about how many of the DB files to backup. Suggestions requested.

I would add `md5sum` to the backup for each of the two DB files.

Thinking about usage would be:

```auto
./DBRepair.sh backup "/path/to/backup/directory"

```

```auto
./DBRepair.sh restore "/path/to/backup/directory/BackupFileName"

```

In the menu (interactive), it would ask for input before proceding. A blank line (no path given) would return to the menu.

---

<div class="post-metadata">

**Author:** ![michael\_766](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@michael\_766](https://forums.plex.tv/u/michael_766)\
**Post date:** [March 3, 2025, 12:17am UTC](https://forums.plex.tv/t/dbrepair-development/822684/536 "2025-03-03T00:17:38Z")

</div>

But is there a reason to not ship it with Plex? Doesn’t take up much space. And if anyone ask for help with any database issues you’ll know they have this already installed to point them to run.

---

<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:** [March 3, 2025, 12:41am UTC](https://forums.plex.tv/t/dbrepair-development/822684/537 "2025-03-03T00:41:45Z")

</div>

@michael_766

Plex has not ask me for permission to include it.  
Also, if they include it, there is a sense of “their version” which they’d be obligated to support.

---

<div class="post-metadata">

**Author:** ![michael\_766](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@michael\_766](https://forums.plex.tv/u/michael_766)\
**Post date:** [March 15, 2025, 6:01am UTC](https://forums.plex.tv/t/dbrepair-development/822684/538 "2025-03-15T06:01:38Z")

</div>

Would It be possible to add an option for clearing out any DVR and Tuners? Think one of the tuners may have caused an issue where one of my libraries won’t load the recommended page any more. For now going to try fixing it manually from [Clear all DVR settings and start again Windows Plex Server - #2 by OttoKerner](https://forums.plex.tv/t/clear-all-dvr-settings-and-start-again-windows-plex-server/830692/2)

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 17, 2025, 3:13pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/539 "2025-03-17T15:13:00Z")

</div>

Hi, after running DBRepair 1.10.0`2, I have noticed the following.

MacOS

Does this indicate any issue I need worry about, it appears on every repair in terminal?

`sed: RE error: illegal byte sequence`

Cheers

---

<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:** [March 17, 2025, 4:24pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/540 "2025-03-17T16:24:40Z")

</div>

@SE56

Yes, that’s significant. What were you doing to cause it ?

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 17, 2025, 7:27pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/541 "2025-03-17T19:27:54Z")

</div>

I do not know, Is there a common way it can happen. It seems it is not causing a issue that I can detect.

It shows up in Terminal after using PlexDBRepair.

---

<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:** [March 17, 2025, 8:07pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/542 "2025-03-17T20:07:14Z")

</div>

when you ran it, what was it doing / which commands did you issue ?

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 17, 2025, 10:44pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/543 "2025-03-17T22:44:26Z")

</div>

“2” and finished with “exit”

 ![Screenshot 2025-03-18 at 8.47.03 am](https://global.discourse-cdn.com/plex/original/4X/3/9/5/39505be5a7542eb73a16e7fdf5633a741c3d9774.jpeg)

 ![Screenshot 2025-03-18 at 8.47.50 am](https://global.discourse-cdn.com/plex/original/4X/4/c/3/4c3788657da1622d232aea5c5d21e7e37a2c8c41.jpeg)

---

<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:** [March 17, 2025, 11:26pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/544 "2025-03-17T23:26:07Z")

</div>

@SE56

I found where the error is occurring – EXCEPT – this is _original_ code.  
I do not understand why it’s failing now.

Are you using an old or new version of MacOS (some new ‘undocumented features’ ?)

Regardless, let’s see if we can circumvent it.

* * *

- Open a terminal window.

- Type the following and confirm the error

`echo 'COMMIT;' | sed -e 's/COMMIT;/JUNK;/'`

- If you confirm the same RE error, now try

`echo 'COMMIT;' | sed -e 's/COMMIT\;/JUNK\;/'`

Confirm you don’t get any errors  
AND  
You get `JUNK;` as the output.

```auto
[chuck@lizum ~.2001]$ echo 'COMMIT;' | sed -e 's/COMMIT\;/JUNK\;/'
JUNK;

```

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 17, 2025, 11:27pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/545 "2025-03-17T23:27:07Z")

</div>

MacOS 15.3.2

 ![Screenshot 2025-03-18 at 9.28.53 am](https://global.discourse-cdn.com/plex/original/4X/0/5/0/0507935f301b34a3ee25bfd0ff5abc34f3a0d443.jpeg)  
 ![Screenshot 2025-03-18 at 9.33.46 am](https://global.discourse-cdn.com/plex/original/4X/0/5/2/05229288099aa55fba7c1d3f6d41300da6384d1f.jpeg)

Same

Tried next one

 ![Screenshot 2025-03-18 at 9.36.44 am](https://global.discourse-cdn.com/plex/original/4X/8/5/9/85950396b24c80345ff86a02a4a5c6885e466601.jpeg)

Same Error 🤔 There probably been 2 small updates since release  
@ChuckPa

---

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [March 18, 2025, 12:17am UTC](https://forums.plex.tv/t/dbrepair-development/822684/546 "2025-03-18T00:17:19Z")

</div>

Have you modified your shell environment? What’s your $LANG?

%`echo $LANG`

---

<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:** [March 18, 2025, 12:27am UTC](https://forums.plex.tv/t/dbrepair-development/822684/547 "2025-03-18T00:27:42Z")

</div>

By definition of REs (Regular Expressions), the semicolon in `s/COMMIT\;/` will be taken literally.

You’ve not shown me where the command line reports the error.

Can you, using the command line, replicate the RE errors your tool output showed ?

I can’t replicate it here.

The second example will, by definition avoid the problem

This is where it’s occurring but there should be TWO of them.

```auto

    # Edit the .SQL files if all OK
    if [$Fail -eq 0]; then

      # Edit
      sed -i -e 's/ROLLBACK;/COMMIT;/' "$TMPDIR/library.plexapp.sql-$TimeStamp"
      sed -i -e 's/ROLLBACK;/COMMIT;/' "$TMPDIR/blobs.plexapp.sql-$TimeStamp"
    fi

```

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 1:37am UTC](https://forums.plex.tv/t/dbrepair-development/822684/548 "2025-03-18T01:37:08Z")

</div>

No I have not changed anything other than MacOS updates

 ![Screenshot 2025-03-18 at 11.58.02 am](https://global.discourse-cdn.com/plex/original/4X/6/1/4/614a80ca6e00fa5c97e7b2320858b10ba10e404a.jpeg)

@Volts

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 1:50am UTC](https://forums.plex.tv/t/dbrepair-development/822684/549 "2025-03-18T01:50:58Z")

</div>

> [@ChuckPa](#):
>
> echo ‘COMMIT;’ | sed -e ‘s/COMMIT;/JUNK;/’

 ![Screenshot 2025-03-18 at 11.48.22 am](https://global.discourse-cdn.com/plex/original/4X/9/9/5/995ddf0daa269dc0a0fe3a3b5248e387a76dadd9.jpeg)

as requested

---

<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:** [March 18, 2025, 2:05am UTC](https://forums.plex.tv/t/dbrepair-development/822684/550 "2025-03-18T02:05:08Z")

</div>

I requested this please:

```auto
echo 'COMMIT;' | sed -e 's/COMMIT;/JUNK;/' 

```

See if this is the error.

If not then I’m going to need some serious DEBUG help with MacOS because there’s some stupid new bug in otherwise rock solid code.

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 2:11am UTC](https://forums.plex.tv/t/dbrepair-development/822684/551 "2025-03-18T02:11:57Z")

</div>

> [@ChuckPa](#):
>
> `echo 'COMMIT;' | sed -e 's/COMMIT;/JUNK;/'`

 ![Screenshot 2025-03-18 at 12.11.11 pm](https://global.discourse-cdn.com/plex/original/4X/a/3/f/a3fa4968b898b48ce2f544532fa9e6f0c96b08e1.jpeg)

Could this be possibly be the following, introduced recently.

 ![Screenshot 2025-03-18 at 12.14.43 pm](https://global.discourse-cdn.com/plex/original/4X/0/5/0/05058076c39035bee6abbdd51ad84fe7d30e35c8.jpeg)

I have it disabled

---

<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:** [March 18, 2025, 2:19am UTC](https://forums.plex.tv/t/dbrepair-development/822684/552 "2025-03-18T02:19:43Z")

</div>

OOOOOOH, this is going to get ugly.

no error on that regular expression (the only one used in “Auto” processing.

I will do my best to figure out what’s happening but i’m leaning toward a MacOS bug.

Stable code doesn’t just ‘fail’ after all this time.

---

<div class="post-metadata">

**Author:** ![SE56](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/se56/32/222425_2.png) [@SE56](https://forums.plex.tv/u/SE56)\
**Post date:** [March 18, 2025, 2:20am UTC](https://forums.plex.tv/t/dbrepair-development/822684/553 "2025-03-18T02:20:54Z")

</div>

Sh.t, that a nasty outcome 🫣

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

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