DBRepair development

@causefx

Thank you! I’ll add that to the README

1 Like

I can also test it once you merge.

The code here is a Ctrl-A + Paste of what I pushed.
Once I get the OK, I’ll PR and merge

Not working.

@Sittingmongoose @causefx

  1. Detection issue resolved.
  2. Published - v0.6.4
root@hotioplex:/# ./DBRepair.sh 
 
 
 
      Plex Media Server Database Repair Utility (HOTIO)
 
Select
 
  1. Check database
  2. Vacuum database
  3. Reindex database
  4. Attempt database repair
  5. Replace current database with newest usable backup copy
  6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
  7. Import Viewstate / Watch history from another PMS database
  8. Show logfile
  9. Exit
 
Enter choice: 1
 
Checking the PMS databases
Check complete.  PMS main database is OK.
Check complete.  PMS blobs database is OK.
 
 
      Plex Media Server Database Repair Utility (HOTIO)
 
Select
 
  1. Check database
  2. Vacuum database
  3. Reindex database
  4. Attempt database repair
  5. Replace current database with newest usable backup copy
  6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
  7. Import Viewstate / Watch history from another PMS database
  8. Show logfile
  9. Exit
 
Enter choice: 4
 
Exporting current databases using timestamp: 2023-01-08_14.37.29
Export: (main)..(blobs)..done.
Successfully exported the main and blobs databases.  Proceeding to import into new databases.
Import: (main)..(blobs)..done.
Successfully imported data from exported SQL files.
Verifying databases integrity after importing.
Verification complete.  PMS main database is OK.
Verification complete.  PMS blobs database is OK.
Saving current databases with '-ORIG-2023-01-08_14.37.29'
Making imported databases active
Import complete. Please check your library settings and contents for completeness.
Recommend:  Scan Files and Refresh all metadata for each library section.
 
 
      Plex Media Server Database Repair Utility (HOTIO)
 
Select
 
  1. Check database
  2. Vacuum database
  3. Reindex database
  4. Attempt database repair
  5. Replace current database with newest usable backup copy
  6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
  7. Import Viewstate / Watch history from another PMS database
  8. Show logfile
  9. Exit
 
Enter choice:
1 Like

It worked :slight_smile: awesome job! You are the best!!

How’s the performance gain?

(check searches)

I didn’t run it again, I just went into the menu. I have just run it twice prior to you updating the script. It made a profound difference. Loading up my libraries and search are dramatically faster.

@sixxnet

Care to join here please?

How common is podman usage?
Is it worth me adding?

Anybody using CentOS/RHEL/Fedora most likely will be using podman rather than docker so if you think it’s worth it… it wasn’t much to force it but for others it might be…

I’ll be happy to add support for it.

If you can help me definitively detect the hypervisor’s (podman) environment, I’ll add it to the detection ( e.g. “Docker” or “Podman” )

@ChuckPa is it possible to get just the commands to copy the watched history?

You want the commands ?

I already have importing the watch history built into the tool

@ChuckPa yeah I’m working on a script of my own that copies the database from 1 server to another and it doesn’t save the watched states.

@NorseVale

You can copy a DB and simply purge the metadata_item_settings table.

That’s not a big deal. (delete from metadata_item_settings;) and it’s done.

ALL:

By popular request, I’ve started a major update.

Highlights are:

  1. Command NAMES. No “Option 1,4,3” anymore
  • Command names will minimally require 4 characters (guarantee uniqueness)
  1. “Auto[matic]” mode – which will “check, repair, reindex” if no errors

  2. WHERE AVAILABLE – “Stop” and “Start” will be enabled to Stop and Start PMS for you on that particular host / environment.

To give you a idea where this is headed:

./DBRepair.sh   stop auto start show exit
  1. STOP Plex
  2. AUTO repair/optimize (stopping if there are errors to protect your data)
  3. STARt Plex
  4. SHOW logfile
  5. EXIT this utility

All previous features will be present with the addition of “auto” , “start”/“stop” (where supported)

Thoughts?

3 Likes

That’s easy enough to disable.

I like it.

I was going to run it this weekend but I’ll wait until you have this ready for prime time.

Meanwhile, I’m going to take a look at beets, which runs on Python. Metadata fixer on steroids, that.

I keep this in the shell.

I did it this way because not all platforms have python installed nor did I want the dependency when you needed to use it in a pinch.

1 Like
  1. I did the release for adding HOTIO support because it was worthy.

  2. There were two commits to update README.md.

  3. I’ve not spun a new release (for the README) and won’t until I’m ready to release this new overhaul. It was a trivial documentation change unworthy of spinning a version tag

(30% coded with a few fragments tested)