DBRepair development

Argh, I keep forgetting about that. I need to add the Ethernet switch, which means finding the wall wart for it. Or maybe just buying a new switch.

You shouldn’t need a managed switch if MacOS contains the controls.
My mini has one adapter so I can’t go see what it offers.

1 Like

Thing is, this Mini is using WiFi, not Ethernet. The switch is because my router is out of ports — I got the switch some time ago to cope with that, and never used it, then moved and ended up with stuff scattered because of the movers.

I’ve been advised to hardwire the connection before, and I’ve looked into the binding thing as well…I think I got distracted. I could have freed a port, but that would have put SolidSnek on WiFi, and it’s, well, not good at that.

I went in and checked…doesn’t show up when I take the normal route, but I have the database directory open and just checked info on one of the files.

So everything’s where it (by default) should be.

Try this for me. This is directly from my mini’s console.


Last login: Fri Apr 14 21:27:08 on ttys001
chuck@mini ~ % echo $HOME
/Users/chuck
chuck@mini ~ % cd ~/Library/Application\ Support/Plex\ Media\ Server 
chuck@mini Plex Media Server % ls
Codecs		Drivers		Plug-in Support	Thumbnails
Crash Reports	Media		Plug-ins	Updates
Diagnostics	Metadata	Setup Plex.html
chuck@mini Plex Media Server % 

If you have that, then check here.

Detection is dependent on having ā€œPlex Media Serverā€ in the Applications folder (properly installed).

  # Apple Mac
  elif [ -d "/Applications/Plex Media Server.app" ] && \
       [ -d "$HOME/Library/Application Support/Plex Media Server" ]; then

Okay, @ChuckPa, I’m going to fly something possibly REALLY stupid past you and see if you think this could work.

  1. Copy the database folder from the Littlemac installation to a flash drive.
  2. Sneakernet that to the SolidSnek machine, which runs Windows 10.
  3. Shut down Plex on SolidSnek. Use Task Manager to be sure.
  4. Rename the local database folder (perhaps make a backup.)
  5. Copy over the Littlemac database folder
  6. Copy in the Windows batch file
  7. Run
  8. When done, reverse course. Backup the Littlemac folder. Load in hopefully cleaned up database folder.
  9. Restart Plex on Littlemac and see what happens.

Could this work? It’s an awkward way of doing it, I know.

Well, absent a reply telling me I’m an idiot, I’m going to try this later this evening.

Here’s an easier way.

The tool only cares about the databases

Copy the ā€œDatabasesā€ directory back and forth in the manner you propose.

Why it doesn’t work for you is beyond understanding.

I look for the app in ā€˜/Applications/Plex Media Server’

I look for ā€˜~/Library/Application Support’ – which you verified.

WTHeck is different with your machine than everyone else’s ?
Do you not have it stored as ā€œ/Applications/Plex Media Serverā€ ??

1 Like

I’ll do the Sneakernet approach, then. I’ll let you know how it goes.

As for what’s different with my Mini…I’m clueless! Everything seems to be where it’s supposed to be, and the installation was a default setup. Yet…it breaks.

I honestly haven’t done anything unorthodox here! And yet….

Thanks for your patience.

Alright, Sneakernetting done, and database tool running on the Windows box. This may take a while (it’s anything up to an hour on SolidSnek, and it’s far from as loaded as Littlemac.). I have a backup copy of Littlemac’s darabases in case this goes worng.

When you copy it back ----

  1. Rename the existing ā€˜Databases’ directory to ā€˜Databases-old’
  2. Create a new ā€œDatabasesā€ directory (with the right permissions)
  3. Put all the files in from the thumb drive

I say this because WAL and SHM files will be folded into the main DB as part of the cleanup optimization

If stray WAL or SHM files exist after optimizing (PMS first start) – it will immediately corrupt the database – duplicate and record misalignment

1 Like

Already on that. The older files will go away to a backup and it’ll be all new. If things go south I can restore.

I think I’m going to head for bed right now. We’ll see what the morning brings.

Alright, so far so good. Got up this morning to the Mini updated,and did the directory swap and restarted Plex. I’ll see shortly if it’ll do Library updates without ghosting……

Just as a note, the database repair went a lot faster than I expected.

If you look at the ā€œDBRepair.logā€ file, it’ll contain info about the size changes (Before and after sizes)

I glanced at it, should look closer.

It might have been long winded, but the stunt worked like a charm. I’m updating libraries right now, and zero ghosting is going on. Plus, the updates are screaming along.

Hey Chuck, been away for a bit, but I just read about @wyldemusick and the script not finding the Mac. RIP my notifications I guess. That was unintentional.

I ran the latest DBRepair-1.04 on my older intel Mini and it works for me on 10.14.6, Mojave.
I ran the latest DBRepair on my new M1 Studio and it also works on Monterey.

My guess is permissions, but we should be able to find out something from adding a few echo commands. I guess we could use a debug mode on the utility.

Try this in a terminal, Steven

if [ -d "/Applications/Plex Media Server.app" ] && [ -d "$HOME/Library/Application Support/Plex Media Server" ]; then echo FoundEm; else echo Darnit; fi

So your session would look something like this as you paste and run it:

stevenmcdonald@192-168--0-113 Downloads % sh
sh-3.2$ 
sh-3.2$ if [ -d "/Applications/Plex Media Server.app" ] && [ -d "$HOME/Library/Application Support/Plex Media Server" ]; then echo FoundEm; else echo Darnit; fi
sh-3.2$ FoundEm
sh-3.2$

The above only tests to see if the directories exist, not that you can read into them.
Hopefully you get a FoundEm.

Further debugging can be done to see if the database is readable.
Let’s hope your stevenmcdonald user is an administrator. Then run this at a sh-3.25$ prompt:

if [ -r "$HOME/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" ]; then echo CanRead; else echo FixYourPerms; fi

On my system I get a CanRead. Finger’s crossed :slight_smile:

I’ll give it a go when I have a minute or six free…my life has gotten kind of tight between probably moving and medical issues that need resolving.

Of course, now’s also the time when the Mac server goes into Ghost Mode, which means having to try the long way around again. The last time it did this do enthusiastically I ended up rebuilding the entire library.