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

<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:** [November 7, 2024, 12:07am UTC](https://forums.plex.tv/t/dbrepair-development/822684/514 "2024-11-07T00:07:01Z")

</div>

Well then

abolish  
eliminate  
expunge  
obliterate  
nullify  
extirpate  
expunge  
efface  
trim 😉

---

<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:** [November 7, 2024, 2:03am UTC](https://forums.plex.tv/t/dbrepair-development/822684/515 "2024-11-07T02:03:53Z")

</div>

Got it.

I hate it when I mix up `" and `’

For your consideration -

[DBRepair-v1.09.00-TEST.tar](https://forums.plex.tv/uploads/short-url/ivDkS3bOxZeTvj0rhnO8OlnIpGv.tar) (110 KB)

---

<div class="post-metadata">

**Author:** ![nx6](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nx6/32/103992_2.png) [@nx6](https://forums.plex.tv/u/nx6)\
**Post date:** [November 7, 2024, 2:43am UTC](https://forums.plex.tv/t/dbrepair-development/822684/516 "2024-11-07T02:43:28Z")

</div>

If the affected files are limited to a certain time period (\>24 hours old), any term implying a completeness in erasure seems inaccurate. “Trim”, “prune”, or “shave” would be better I feel.

---

<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:** [November 7, 2024, 3:02am UTC](https://forums.plex.tv/t/dbrepair-development/822684/517 "2024-11-07T03:02:54Z")

</div>

That’s why I thought ‘purge’ … nothing with a limit

“Prune” is already used for the controlled removal of transcoder cache files  
(variable DBREPAIR\_CACHEAGE as documented in the README.md)

The reason I make it wait 24 hours is because I want to be certain PMS does not need the files.

---

<div class="post-metadata">

**Author:** ![Insomnic\_1](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/insomnic_1/32/215416_2.png) [@Insomnic\_1](https://forums.plex.tv/u/Insomnic_1)\
**Post date:** [November 7, 2024, 6:38pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/518 "2024-11-07T18:38:14Z")

</div>

I like purge because it makes sense and because it sounds like it goes with prune. 🙂

---

<div class="post-metadata">

**Author:** ![anon5074910](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@anon5074910](https://forums.plex.tv/u/anon5074910)\
**Post date:** [November 7, 2024, 6:43pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/519 "2024-11-07T18:43:46Z")

</div>

For what its worth **Purge** gets my vote. Its what GNOME call it also when you delete temp files so good to keep it consistent as its kinda doing the same thing …

 ![Screenshot from 2024-11-07 18-41-17](https://global.discourse-cdn.com/plex/original/4X/d/2/3/d23b5aa31482c59c991fe57ef1e77cf18773dedb.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:** [November 7, 2024, 7:02pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/520 "2024-11-07T19:02:41Z")

</div>

Then, in the interest of uniformity with other apps, “PURGE” it is 🙂

So is it working ok for everyone so far ?

---

<div class="post-metadata">

**Author:** ![Insomnic\_1](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/insomnic_1/32/215416_2.png) [@Insomnic\_1](https://forums.plex.tv/u/Insomnic_1)\
**Post date:** [November 8, 2024, 5:50pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/521 "2024-11-08T17:50:28Z")

</div>

I ran it for Auto - which is what I typically use - and Prune. Didn’t have any issues on my QNAP; Prune just reported nothing found (which is what I expected really).

Edit: meant Purge, not Prune… 🤦‍♂️

---

<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:** [November 8, 2024, 6:09pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/522 "2024-11-08T18:09:00Z")

</div>

@Insomnic_1

Did you try the purge ?

---

<div class="post-metadata">

**Author:** ![Insomnic\_1](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/insomnic_1/32/215416_2.png) [@Insomnic\_1](https://forums.plex.tv/u/Insomnic_1)\
**Post date:** [November 8, 2024, 6:20pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/523 "2024-11-08T18:20:43Z")

</div>

Dangit… typed Prune but meant Purge… guess the alliteration didn’t help after all. 🙂

---

<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:** [November 8, 2024, 6:36pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/524 "2024-11-08T18:36:20Z")

</div>

I can’t help it if you can’t write 😛 lol

It can be very quick. I just purged mine last night so there’s nothing to do.

```auto
[chuck@lizum PlexDBRepair.2014]$ sudo ./DBRepair.sh stop purge start
 
 
 
      Plex Media Server Database Repair Utility (Ubuntu 22.04.5 LTS)
                       Version v1.09.00
 
 
[2024-11-08 13.35.47] Stopping PMS.
[2024-11-08 13.35.47] Stopped PMS.
 
[2024-11-08 13.35.47] Purging started.
[2024-11-08 13.35.47] Purging completed.
 
[2024-11-08 13.35.47] Starting PMS.
[2024-11-08 13.35.47] Started PMS
 
[chuck@lizum PlexDBRepair.2015]$ 

```

---

<div class="post-metadata">

**Author:** ![Tony\_T](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tony_t/32/311528_2.png) [@Tony\_T](https://forums.plex.tv/u/Tony_T)\
**Post date:** [November 9, 2024, 11:53am UTC](https://forums.plex.tv/t/dbrepair-development/822684/525 "2024-11-09T11:53:27Z")

</div>

Is v1.09.00 beta? Tried 88 in v1.07 and it returns  
“Checking for update  
No update available.”

---

<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:** [November 9, 2024, 4:48pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/526 "2024-11-09T16:48:28Z")

</div>

@Tony_T

Not yet released so it’s here as beta / test

In _this_ thread.

see above.

> [@PlexDBRepair development](https://forums.plex.tv/t/plexdbrepair-development/822684/515):
>
> Got it. I hate it when I mix up " and ’ For your consideration - [DBRepair-v1.09.00-TEST.tar](https://forums.plex.tv/uploads/short-url/ivDkS3bOxZeTvj0rhnO8OlnIpGv.tar) (110 KB)

---

<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:** [November 9, 2024, 5:23pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/527 "2024-11-09T17:23:11Z")

</div>

### ALL:

I am having second thoughts about two commands: Prune & Purge.

I’m considering merging the two:

1. Prune will continue to work as written
2. Purge will be merged into Prune with a preset age of 1 day.

Why have two commands when the second command does so little.

Thoughts?

---

<div class="post-metadata">

**Author:** ![Insomnic\_1](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/insomnic_1/32/215416_2.png) [@Insomnic\_1](https://forums.plex.tv/u/Insomnic_1)\
**Post date:** [November 9, 2024, 6:03pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/528 "2024-11-09T18:03:56Z")

</div>

> [@ChuckPa](#):
>
> Why have two commands when the second command does so little.

Makes sense and seems like a good idea to me. 👍

---

<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:** [November 14, 2024, 10:09pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/529 "2024-11-14T22:09:36Z")

</div>

## ALL:

I’ve put ‘prune’ and ‘purge’ together as one command ( PRUNE ).

Existing Prune functionality has not been changed

Purge will remove all temp files more than 1 day old.  
(This ensures playback is not paused when the tool runs)

For your consideration:

[DBRepair-v1.09b.tar](https://forums.plex.tv/uploads/short-url/ia1IPqlPy5KWQajyHbjDaJb2cdZ.tar) (150 KB)

---

<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:** [December 30, 2024, 4:01am UTC](https://forums.plex.tv/t/dbrepair-development/822684/530 "2024-12-30T04:01:19Z")

</div>

## Folks:

One last update to finish the year. 🕶

### DBRepair 1.10.0

- Change Yes/No DB selector to a menu
- Do not check the candidate DBs until after making your selection

It looks like this:

```auto
[chuck@lizum PlexDBRepair.2005]$ sudo ./DBRepair.sh 
 
 
 
      Plex Media Server Database Repair Utility (Ubuntu 22.04.5 LTS)
                       Version v1.10.00
 

Select

  1 - 'stop' - Stop PMS.
  2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
  3 - 'check' - Perform integrity check of database.
  4 - 'vacuum' - Remove empty space from database without optimizing.
  5 - 'repair' - Repair/Optimize databases.
  6 - 'reindex' - Rebuild database indexes.
  7 - 'start' - Start PMS

  8 - 'import' - Import watch history from another database independent of Plex. (risky).
  9 - 'replace' - Replace current databases with newest usable backup copy (interactive).
 10 - 'show' - Show logfile.
 11 - 'status' - Report status of PMS (run-state and databases).
 12 - 'undo' - Undo last successful command.

 21 - 'prune' - Prune (remove) old image files (jpeg,jpg,png) from PhotoTranscoder cache.
 22 - 'purge' - Purge (remove) all temporary files left by PMS & Transcoder in Temp Dir.
 42 - 'ignore' - Ignore duplicate/constraint errors.

 88 - 'update' - Check for updates.
 99 - 'quit' - Quit immediately. Keep all temporary files.
      'exit' - Exit with cleanup options.

Enter command # -or- command name (4 char min) : Repl
 
Checking the PMS databases
Check complete. PMS main database is OK.
Check complete. PMS blobs database is OK.
Are you sure you want to restore a previous database backup (Y/N) ? y
Checking for a usable backup.
Database backups available are: 2024-11-19 2024-11-01 2024-10-29 2024-10-26
 
  1) - 2024-11-19
  2) - 2024-11-01
  3) - 2024-10-29
  4) - 2024-10-26
 
Select backup date by number or date name (blank = return to menu) 3
Checking backup candidate 2024-10-29
Database backup 2024-10-26 is valid.
 
Use backup dated: '2024-10-29' ? (Y/N) ? y
Saving current databases with timestamp: '-BACKUP-2024-12-29_23.00.36'
Copying backup database from 2024-10-29 to use as new database.
Copy complete. Performing final check
 
Database recovery and verification complete 

```

Thoughts?

[DBRepair-1.10.tar](https://forums.plex.tv/uploads/short-url/u9aIgrU63ErxAyL8sLP31fll6bP.tar) (80 KB)

Line 1234 should be:  
` Output "Database backup $Candidate is valid."`

---

<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:** [December 30, 2024, 4:47pm UTC](https://forums.plex.tv/t/dbrepair-development/822684/531 "2024-12-30T16:47:25Z")

</div>

### DBRepair v1.10.0

- Release Notes updated
- Published

#### EDIT: 1.10.01 releasing shortly. minor issue discovered

---

<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 1, 2025, 7:14am UTC](https://forums.plex.tv/t/dbrepair-development/822684/532 "2025-03-01T07:14:41Z")

</div>

Is there any plan to eventually incorporate the DBRepair script as part of the files generated by a Plex install/upgrade? So that when the server is shutdown the script can be run manually?

---

<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 1, 2025, 8:10am UTC](https://forums.plex.tv/t/dbrepair-development/822684/533 "2025-03-01T08:10:41Z")

</div>

That would be something that i would support. 😀  
@ChuckPa

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

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