That error is generated by PowerShell, not sqlite3 (or Plex). The steps provided the linked procedure need to be run in the “Command Prompt” application. You can open it by clicking the start button in Windows and typing “command prompt.” Or, just run “cmd” from within PowerShell.
Also, depending on your Plex Media Server version, you may need to use its embedded sqlite3 command. Check in C:\Program Files (x86)\Plex\Plex Media Server\ to see if you have “Plex SQLite.exe.” If so, use that to carry out the linked procedure.
That’s what I was alluding to in my second paragraph. Recent (relatively) database changes have introduced a dependency on Plex’s built-in SQLite3 application. Not using it will result in the error you quoted.
Check your Plex Media Server installation directory; see if there’s an application named “Plex SQLite.exe.” If so, use that to perform the database repair process. If not, use Plex Media Server.exe with its “–sqlite” option to invoke its embedded SQLite3 module: C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe --sqlite (in place of any command with references sqlite3).
I sincerely appreciate your help. I dont have the exe version but using Plex Media Server.exe --sqlite , when i do the dump it just creates an empty file that is 0kb.
Plex Media Server.exe --sqlite com.plexapp.plugins.library.db > dump.sql
Did you include the “.dump” portion of the command?
Plex Media Server.exe --sqlite com.plexapp.plugins.library.db .dump > dump.sql
If so, and it still produced an empty file, I’m not sure what else to suggest. It may be worth it to upgrade to the latest Plex Pass release (1.23.1.4528) so that you can use “Plex SQLite.exe”.
ahh okay, looks like their steps for repairing a database are outdated. Which command do I use to restore the dump back to a database file? Also do you know if there is a reference somewhere for the basic command switches to use with their built in version of sqlite? Thank you again!
I believe this should work. Just make sure you have a backup (per the instructions) of your current database first, just in case you need to go through the process again:
"Plex Media Server.exe" --sqlite com.plexapp.plugins.library.db < dump.sql
I performed a test using the linked instructions and they worked fine (using the embedded sqlite module).
As far as I know, the available commands should be the same as (or a superset of) those available for the standard sqlite3 executable.
It still just created a 0kb dump file. I have my metadata/databases in a customer folder
D:\PlexMetadata\Plex Media Server\Plug-in Support\Databases
and my Plex install is in:
D:\Program Files (x86)\Plex\Plex Media Server
I wasnt sure how to get it to recognize where the database file was since it didnt seem to see it when the command was run so I tried temporarily copying the db file to the
D:\Program Files (x86)\Plex\Plex Media Server
directory and that didn’t work, so then i added the install directory to the system path variable which let me run it while in the regular location of the database file but its all still generating a 0kb dump file. Basically when I run
"Plex Media Server.exe" --sqlite com.plexapp.plugins.library.db .dump > dump.sql
It just immediately ends without a proper dump creating the empty 0kb dump file. So frustrating.
I ran through the procedure myself yesterday to test this. However, my Plex Media Server is installed in the default path, on my C: drive. Also, I tested on version 1.23.1.4528. When I tested, I performed all the steps from within my Plex data directory; in my case that’s: C:\Users\username\AppData\Local\Plex Media Server\Plug-in Support\Databases\
I also ran the commands using the full, quoted path to the Plex Media Server executable. For example, to create the dump: "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe" --sqlite com.plexapp.plugins.library.db .dump > dump.sql
You may want to try upgrading to the latest Plex Pass beta release, if you haven’t already.