So, I’ve been seeing a lot of posts about issues with the database on recent Plex Media Server releases (stuff not working after an update, and corruption in the database being pointed to as the cause). Why all these databases worked fine in previous versions and are suddenly not good with the newest releases is another topic.
What I’m really here asking for is guidance on using the Plex SQLite tool. See, I figure it would be best to check my existing database and fix it if it needs it before I do any upgrading. I’m on 1.25.9.5721 right now.
I can access the jail I have Plex in on SSH, I’ve copied the database to make a backup, and I’ve located the “Plex SQLite” tool in the files. The issue is how to actually run it. The support document just says to do:
"Plex SQLite" [path to database]
That’s not working for me. I just get a “command not found” error.
And the directions after that all are from within the sqlite tool itself, so if you didn’t get there you’re stuck.
root@plex-4:/usr/local/share/plexmediaserver-plexpass # ls
CrashUploader Plex Media Scanner Plex Transcoder
lib Plex Media Server Plex Tuner Service
Plex Commercial Skipper Plex Relay Plex_Media_Server
Plex DLNA Server Plex Script Host Resources
Plex Media Fingerprinter Plex SQLite start.sh
root@plex-4:/usr/local/share/plexmediaserver-plexpass # cd Plex_Media_Server
Plex_Media_Server: Not a directory.
So it’s not inside there.
But the “Plex SQLite” seems to be right here in plexmediaserver-plexpass…
root@plex-4:/usr/local/share/plexmediaserver-plexpass # "Plex SQLite" "/usr/local/plexdata-plexpass/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db"
Plex SQLite: Command not found.
Edit: “Plex_Media_Server” looks like it’s a symlink elsewhere:
l0newo1f@osage:/usr/lib/plexmediaserver$ "Plex SQLite"
Plex SQLite: command not found
l0newo1f@osage:/usr/lib/plexmediaserver$ "./Plex SQLite"
SQLite version 3.35.5 2021-04-19 18:32:05
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .quit
l0newo1f@osage:/usr/lib/plexmediaserver$
root@plex-4:/ # cd /usr/local/share/plexmediaserver-plexpass/
root@plex-4:/usr/local/share/plexmediaserver-plexpass # service plexmediaserver_plexpass stop
Stopping plexmediaserver_plexpass.
Waiting for PIDS: 85681, 85681.
Cleaning up leftover child processes.
Waiting for PIDS: 85682, 85682.
root@plex-4:/usr/local/share/plexmediaserver-plexpass # "./Plex SQLite" "/usr/local/plexdata-plexpass/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db"
SQLite version 3.35.5 2021-04-19 18:32:05
Enter ".help" for usage hints.
sqlite> PRAGMA integrity_check;
ok
sqlite>