Skip to content

Typical Usage

ChuckPa edited this page Oct 16, 2026 · 1 revision

DBRepair works on the databases only while Plex Media Server is stopped. Automatic stops and restarts Plex Media Server for you where the host allows it. For every other command, stop Plex Media Server first.

A. Routine maintenance, or you're not sure what's wrong

Use Automatic (2). It checks both databases first. If they're healthy it does nothing. If either needs work, both are rebuilt together and verified before Plex Media Server is restarted.

  1. (2) Automatic
  2. (99) Exit

Example: ./DBRepair auto exit

B. Database is malformed - Plex backups available

  1. (2) Automatic - Does the job.
  2. (9) Replace - If Automatic can't, this is next. Each backup is checked first.
  3. (99) Exit

C. Database is malformed - no backups

  1. (3) Check - Confirm which database is damaged.
  2. (5) Repair - Salvage as much as possible into new databases.
  3. (99) Exit

If Repair reports unrecoverable damage, the only option left is Replace with a Plex backup. Restoring a database from anywhere else is your responsibility.

D. Database is far larger than the amount of media indexed

  1. (2) Automatic - Deflates the bloated table as part of the run.
  2. (99) Exit

(23) Deflate is available on its own if you only want that step, but slower.

E. Interface has become sluggish as more media was added and Automatic isn't helping

  1. (3) Check - Confirm there is no damage.
  2. (5) Repair - Force a full rebuild. You're rebuilding the database in perfect sorted order.
  3. (99) Exit

F. HTTP 500 errors when adding to collections (FTS index corruption)

Standard integrity checks pass but the FTS (Full-Text Search) indexes are damaged.

  1. (3) Check - Reports the FTS indexes as damaged.
  2. (5) Repair - Rebuilds the databases, including FTS.
  3. (99) Exit

(2) Automatic finds and repairs this too.

G. Going back - History and Revert

  1. (12) History - Lists every step this session. [0] is your original databases.
  2. (13) Revert - Enter the number to go back to. Everything after it is discarded.

Example: If Replace left you worse off than before, use History to find the index where Replace occurred, then Revert to that index. When it's complete, it's as if the Replace never happened.

Finishing

  • (99) Exit - Normal exit. Cleans up all temporary files.
  • (98) Quit - Aborts and keeps all the temporary files. Use it when you need help.

Back | Next

Clone this wiki locally