and this is what i ment i have it stopped and i get the error
least thats how i understood things away… if i miss understood things then my bad
and this is what i ment i have it stopped and i get the error
least thats how i understood things away… if i miss understood things then my bad
Now, go read the README and Release Notes
i must done something wrong… it doesnt work for me it just says stoping… i tried both sqlite plex folder
apparently the 2 plex sqlite folders are invalid… it wasnt working so i stripped it out and ran it like your example…
i tried my 2 folders and get both invaild sqlite
root@Tardis:~# docker exec Plex-Media-Server /config/Databasetools/DBRepair.sh --sqlite "/var/lib/docker/btrfs/subvolumes/9ef36
38ff2b158bec0b4c37a33276018dc597a9a05d2ecc08629ee1831f064cc-init/usr/lib/plexmediaserver/Plex SQLite" --database "/mnt/user/app
data/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
Given 'Plex SQLite' directory/path ('/var/lib/docker/btrfs/subvolumes/9ef3638ff2b158bec0b4c37a33276018dc597a9a05d2ecc08629ee1831f064cc-init/usr/lib/plexmediaserver/Plex SQLite') is invalid. Aborting.
ill try again tommorow …
root@Tardis:~# docker exec Plex-Media-Server /config/Databasetools/DBRepair.sh --sqlite "/var/lib/docker/btrfs/subvolumes/9ef36
38ff2b158bec0b4c37a33276018dc597a9a05d2ecc08629ee1831f064cc-init/usr/lib/plexmediaserver/Plex SQLite" --database "/mnt/user/app
data/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
Given 'Plex SQLite' directory/path ('/var/lib/docker/btrfs/subvolumes/9ef3638ff2b158bec0b4c37a33276018dc597a9a05d2ecc08629ee1831f064cc-init/usr/lib/plexmediaserver/Plex SQLite') is invalid. Aborting.
those are the 2 plexsqlite folders
I would ask around about that. I don’t have a running unraid at the moment (my office is all torn up with power system overhaul.
On all systems. when you get the paths right, it will print out the paths it’s using.
bash-4.4#
bash-4.4# ./DBRepair.sh --sqlite /var/packages/PlexMediaServer/target/Plex\ SQLite --databases /volume1/PlexMediaServer/AppData/Plex\ Media\ Server/Plug-in\ Support/Databases/
Plex Media Server Database Repair Utility (User Defined)
Version v1.07.00
PlexSQLite = '/var/packages/PlexMediaServer/target/Plex SQLite'
Databases = '/volume1/PlexMediaServer/AppData/Plex Media Server/Plug-in Support/Databases/'
Select
1 - 'stop' - (Not available. Stop manually.)
2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
3 - 'check' - Perform integrity check of database.
4 - 'vacuum' - Remove empty space from database without optimizing.
5 - 'repair' - Repair/Optimize databases.
6 - 'reindex' - Rebuild database indexes.
7 - 'start' - (Not available. Start manually)
8 - 'import' - Import watch history from another database independent of Plex. (risky).
9 - 'replace' - Replace current databases with newest usable backup copy (interactive).
10 - 'show' - Show logfile.
11 - 'status' - Report status of PMS (run-state and databases).
12 - 'undo' - Undo last successful command.
21 - 'prune' - Prune (remove) old image files (jpeg,jpg,png) from PhotoTranscoder cache.
42 - 'ignore' - Ignore duplicate/constraint errors.
88 - 'update' - Check for updates.
99 - 'quit' - Quit immediately. Keep all temporary files.
'exit' - Exit with cleanup options.
Enter command # -or- command name (4 char min) : status
Status report: Sun Jul 21 11:18:36 PM EDT 2024
PMS is running.
Databases are not checked, Status unknown.
Now I stop PMS manually.
Enter command # -or- command name (4 char min) : status
Status report: Sun Jul 21 11:20:24 PM EDT 2024
PMS is stopped.
Databases are not checked, Status unknown.
Select
1 - 'stop' - (Not available. Stop manually.)
2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
3 - 'check' - Perform integrity check of database.
4 - 'vacuum' - Remove empty space from database without optimizing.
5 - 'repair' - Repair/Optimize databases.
6 - 'reindex' - Rebuild database indexes.
7 - 'start' - (Not available. Start manually)
8 - 'import' - Import watch history from another database independent of Plex. (risky).
9 - 'replace' - Replace current databases with newest usable backup copy (interactive).
10 - 'show' - Show logfile.
11 - 'status' - Report status of PMS (run-state and databases).
12 - 'undo' - Undo last successful command.
21 - 'prune' - Prune (remove) old image files (jpeg,jpg,png) from PhotoTranscoder cache.
42 - 'ignore' - Ignore duplicate/constraint errors.
88 - 'update' - Check for updates.
99 - 'quit' - Quit immediately. Keep all temporary files.
'exit' - Exit with cleanup options.
Enter command # -or- command name (4 char min) : auto
Automatic Check,Repair,Index started.
Checking the PMS databases
Check complete. PMS main database is OK.
Check complete. PMS blobs database is OK.
Exporting current databases using timestamp: 2024-07-21_23.20.28
Exporting Main DB
Exporting Blobs DB
Successfully exported the main and blobs databases.
Start importing into new databases.
Importing Main DB.
Importing Blobs DB.
Successfully imported databases.
Verifying databases integrity after importing.
Verification complete. PMS main database is OK.
Verification complete. PMS blobs database is OK.
Saving current databases with '-BACKUP-2024-07-21_23.20.28'
Making repaired databases active
Repair complete. Please check your library settings and contents for completeness.
Recommend: Scan Files and Refresh all metadata for each library section.
Backing up of databases
Backup current databases with '-BACKUP-2024-07-21_23.21.26' timestamp.
Reindexing main database
Reindexing main database successful.
Reindexing blobs database
Reindexing blobs database successful.
Reindex complete.
Automatic Check, Repair/optimize, & Index successful.
Select
1 - 'stop' - (Not available. Stop manually.)
2 - 'automatic' - Check, Repair/Optimize, and Reindex Database in one step.
3 - 'check' - Perform integrity check of database.
4 - 'vacuum' - Remove empty space from database without optimizing.
5 - 'repair' - Repair/Optimize databases.
6 - 'reindex' - Rebuild database indexes.
7 - 'start' - (Not available. Start manually)
8 - 'import' - Import watch history from another database independent of Plex. (risky).
9 - 'replace' - Replace current databases with newest usable backup copy (interactive).
10 - 'show' - Show logfile.
11 - 'status' - Report status of PMS (run-state and databases).
12 - 'undo' - Undo last successful command.
21 - 'prune' - Prune (remove) old image files (jpeg,jpg,png) from PhotoTranscoder cache.
42 - 'ignore' - Ignore duplicate/constraint errors.
88 - 'update' - Check for updates.
99 - 'quit' - Quit immediately. Keep all temporary files.
'exit' - Exit with cleanup options.
Enter command # -or- command name (4 char min) : exit y
Ok to remove temporary databases/workfiles for this session? (Y/N) ? y
Deleting all temporary work files.
bash-4.4# pwd
/volume1/PlexMediaServer
bash-4.4#
Just as easily , I can do this:
./DBRepair.sh --sqlite /var/packages/PlexMediaServer/target/Plex\ SQLite --databases /volume1/PlexMediaServer/AppData/Plex\ Media\ Server/Plug-in\ Support/Databases/ auto exit
and we see the output switch to command line mode and it do what you told it/.
bash-4.4# pwd
/volume1/PlexMediaServer
bash-4.4# ./DBRepair.sh --sqlite /var/packages/PlexMediaServer/target/Plex\ SQLite --databases /volume1/PlexMediaServer/AppData/Plex\ Media\ Server/Plug-in\ Support/Databases/ auto exit
Plex Media Server Database Repair Utility (User Defined)
Version v1.07.00
[2024-07-21 23.24.44] PlexSQLite = '/var/packages/PlexMediaServer/target/Plex SQLite'
[2024-07-21 23.24.44] Databases = '/volume1/PlexMediaServer/AppData/Plex Media Server/Plug-in Support/Databases/'
[2024-07-21 23.24.44] Automatic Check,Repair,Index started.
[2024-07-21 23.24.44]
[2024-07-21 23.24.44] Checking the PMS databases
[2024-07-21 23.24.46] Check complete. PMS main database is OK.
[2024-07-21 23.24.46] Check complete. PMS blobs database is OK.
[2024-07-21 23.24.46]
[2024-07-21 23.24.46] Exporting current databases using timestamp: 2024-07-21_23.24.44
[2024-07-21 23.24.46] Exporting Main DB
[2024-07-21 23.24.50] Exporting Blobs DB
[2024-07-21 23.24.52] Successfully exported the main and blobs databases.
[2024-07-21 23.26.32] Start importing into new databases.
[2024-07-21 23.26.32] Importing Main DB.
[2024-07-21 23.26.44] Importing Blobs DB.
[2024-07-21 23.26.45] Successfully imported databases.
[2024-07-21 23.26.45] Verifying databases integrity after importing.
[2024-07-21 23.26.47] Verification complete. PMS main database is OK.
[2024-07-21 23.26.47] Verification complete. PMS blobs database is OK.
[2024-07-21 23.26.47] Saving current databases with '-BACKUP-2024-07-21_23.24.44'
[2024-07-21 23.26.47] Making repaired databases active
[2024-07-21 23.26.47] Repair complete. Please check your library settings and contents for completeness.
[2024-07-21 23.26.47] Recommend: Scan Files and Refresh all metadata for each library section.
[2024-07-21 23.26.47]
[2024-07-21 23.26.47] Backing up of databases
[2024-07-21 23.26.47] Backup current databases with '-BACKUP-2024-07-21_23.26.47' timestamp.
[2024-07-21 23.26.47] Reindexing main database
[2024-07-21 23.26.49] Reindexing main database successful.
[2024-07-21 23.26.49] Reindexing blobs database
[2024-07-21 23.26.50] Reindexing blobs database successful.
[2024-07-21 23.26.50] Reindex complete.
[2024-07-21 23.26.50] Automatic Check, Repair/optimize, & Index successful.
bash-4.4#
@ChuckPa i finally your program to work the sqlite… i dunno how i managed it… lol i kept getting that invalid directory issue… but i ran fix common issues made sure all recycling bins was empty… made sure all plugins and dockers were updated… rebooted … did the find search and chose the first plex sqlite out of the 3… and it worked… i now made a script and set it to auto vacuum exit… for every sunday at 5 am… that be good right made clean it up if it needs it or not…
#!/bin/bash
cd /mnt/user/appdata/Plex-Media-Server/Databasetools
echo "Processing Plex Database..Every Sunday At 5am"
echo "Starting DBRepair Tool"
echo "Going To Do Auto Repair Then Vacuum Then Exit.."
./DBRepair.sh --sqlite '/var/lib/docker/btrfs/subvolumes/bfcc91107946fd8f5070a25a314cf86daf70e1b188a8e948a35bbbd137eb40f9/usr/lib/plexmediaserver/Plex SQLite' --databases /mnt/user/appdata/Plex-Media-Server/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/ auto vacuum exit
echo "DBRepair Tool Has Finished"
echo "Processing Has Completed...."
Script location: /tmp/user.scripts/tmpScripts/Plex Database Repair/script
Note that closing this window will abort the execution of this script
Processing Plex Database..Every Sunday At 5am
Starting DBRepair Tool
Going To Do Auto Repair Then Vacuum Then Exit..
Plex Media Server Database Repair Utility (User Defined)
Version v1.07.01
[2024-07-25 15.21.24] PlexSQLite = '/var/lib/docker/btrfs/subvolumes/bfcc91107946fd8f5070a25a314cf86daf70e1b188a8e948a35bbbd137eb40f9/usr/lib/plexmediaserver/Plex SQLite'
[2024-07-25 15.21.24] Databases = '/mnt/user/appdata/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases/'
[2024-07-25 15.21.25] Automatic Check,Repair,Index started.
[2024-07-25 15.21.25]
[2024-07-25 15.21.25] Checking the PMS databases
[2024-07-25 15.22.51] Check complete. PMS main database is OK.
[2024-07-25 15.22.51] Check complete. PMS blobs database is OK.
[2024-07-25 15.22.51]
[2024-07-25 15.22.51] Exporting current databases using timestamp: 2024-07-25_15.21.24
[2024-07-25 15.22.51] Exporting Main DB
[2024-07-25 15.24.42] Exporting Blobs DB
[2024-07-25 15.25.14] Successfully exported the main and blobs databases.
[2024-07-25 15.25.14] Start importing into new databases.
[2024-07-25 15.25.14] Importing Main DB.
[2024-07-25 15.28.09] Importing Blobs DB.
[2024-07-25 15.28.09] Successfully imported databases.
[2024-07-25 15.28.09] Verifying databases integrity after importing.
[2024-07-25 15.29.35] Verification complete. PMS main database is OK.
[2024-07-25 15.29.35] Verification complete. PMS blobs database is OK.
[2024-07-25 15.29.35] Saving current databases with '-BACKUP-2024-07-25_15.21.24'
[2024-07-25 15.29.35] Making repaired databases active
[2024-07-25 15.29.35] Repair complete. Please check your library settings and contents for completeness.
[2024-07-25 15.29.35] Recommend: Scan Files and Refresh all metadata for each library section.
[2024-07-25 15.29.35]
[2024-07-25 15.29.35] Backing up of databases
[2024-07-25 15.29.35] Backup current databases with '-BACKUP-2024-07-25_15.29.35' timestamp.
[2024-07-25 15.29.38] Reindexing main database
[2024-07-25 15.31.12] Reindexing main database successful.
[2024-07-25 15.31.12] Reindexing blobs database
[2024-07-25 15.31.12] Reindexing blobs database successful.
[2024-07-25 15.31.12] Reindex complete.
[2024-07-25 15.31.12] Automatic Check, Repair/optimize, & Index successful.
[2024-07-25 15.31.12] Backing up databases
[2024-07-25 15.31.12] Backup current databases with '-BACKUP-2024-07-25_15.31.12' timestamp.
[2024-07-25 15.31.15] Vacuuming main database
[2024-07-25 15.34.03] Vacuuming main database successful (Size: 1079MB/1079MB).
[2024-07-25 15.34.03] Vacuuming blobs database
[2024-07-25 15.34.04] Vacuuming blobs database successful (Size: 1MB/1MB).
[2024-07-25 15.34.04] Vacuum complete.
DBRepair Tool Has Finished
Processing Has Completed....
Outstanding!
When you use “auto”, you don’t need to “vacuum”.
The database is compacted into perfect order by “auto”.
You can save the time doing that if you wish.
Auto does the following steps: “check, repair/export/import/reindex” with it checking databases between each step to make certain no errors occurred.
You can do ‘prune’ manually if you want. This will let you clean up other things as well to make it faster.
ya it was messed… not sure why it started working.
ok so i removed the vacuum… so when is it good to use vacuum if you got auto and auto does what vacuum does… is there benefits when vacuum is better?
and i added changed vacuum to prune… is prune the same as plexs Trash can and optimize database
and do you know if plex is faster if its on its own seperate ssd instead of the appdata… i tried but i never noticed anything faster still slow generating thumbnails over network like it waits for the hard drives to spin up… and not reach the nvme or a ssd faster… as i try to speed plex up as fast as i can by cleaning bundles optimizing etc… and hopefully prune makes it faster too then
ive also upgraded to 10g networking to try to maximize plex speed and hard drive and ssd/nvme speeds on my network too to get the best performance
vacuum is a simple compaction. There is no reordering of any records.
When auto is used, the space is compacted and ordering completed.
Vacuum provides no benefit
Vacuum is very useful when you have a large table you’ve built over time you want to delete. This is where you’d DROP the entire table then VACUUM the DB to compact the space
@ChuckPa
ah ok sounds easier just to run auto the reordering whatr are you reordering
but sounds its just easier to run the auto when your sleeping and prune then and hope for the best for the best performance… thats what i trying
i set it for 5am sunday so that way once a week and 5am im sure i not watching anything on plex lol… least it solved my issues i was having and hope the weekly auto mode will keep things it tip top shape… (:
oh and should i add update i see you can update can i add that on the weekly since i already got the latest… i not sure if that will work too
auto prune update exit
update is self updating.
Wherever you store the script, it will download, unzip, and put the new script in its place.
This way, it’s like any other real update. “Nothing changes”
(famous last words)
I do my best not to introduce errors and take into account interactive and command line/scripted operation. (it knows the difference)
@ChuckPa
tried to send this last night but had power outage issues
i had power out just now while watching video… and i decided to run your tool… i getting issue it wont stop … it wont stop PMS with the stop…
above i had working when plex was off but since i had it running i had to add the stop auto prune start
but it wont stop the service… i not sure if the power out bugger it up
root@Tardis:/mnt/user/appdata/Plex-Media-Server/Databasetools# ./DBRepair.sh --sqlite '/var/lib/docker/btrfs/subvolumes/bfcc91107946fd8f5070a25a314cf86daf70e1b188a8e948a35bbbd137eb40f9/usr/lib/plexmediaserver/Plex SQLite' --databases /mnt/user/appdata/Plex-Media-Server/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/ stop check auto start
Plex Media Server Database Repair Utility (User Defined)
Version v1.07.01
[2024-07-25 21.36.10] PlexSQLite = '/var/lib/docker/btrfs/subvolumes/bfcc91107946fd8f5070a25a314cf86daf70e1b188a8e948a35bbbd137eb40f9/usr/lib/plexmediaserver/Plex SQLite'
[2024-07-25 21.36.10] Databases = '/mnt/user/appdata/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases/'
[2024-07-25 21.36.10] Start/Stop feature not available
[2024-07-25 21.36.10] Unable to check databases. PMS is running.
[2024-07-25 21.36.10] Unable to run automatic sequence. PMS is running. Please stop PlexMediaServer.
[2024-07-25 21.36.10] Start/Stop feature not available
root@Tardis:/mnt/user/appdata/Plex-Media-Server/Databasetools#
i did read the section “On platform environments which support it, and when invoked by the ‘root’ user, the tool can stop PMS. If not the ‘root’ user or on a platform which doesn’t support it, “Not available” will be indicated.”
so i tried adding “sudo DBRepair.sh xxxxxxx” but that didnt help… i not sure why it worked before and now it doesnt… how i was able to stop it or if it was off now i cant remember… i trying to read the rest of the document you got just not sure how i can force pms to shut down in manual mode… it does work when your inside the program as i have tested that
and i think i need to use "kill -15 $(pidof ‘Plex Media Server’) " from your article… i just confused why it worked before didnt now
guess i figured it out on my own i had to do
docker stop Plex-Media-Server
then run
./DBRepair.sh --sqlite '/var/lib/docker/btrfs/subvolumes/bfcc91107946fd8f5070a25a314cf86daf70e1b188a8e948a35bbbd137eb40f9/usr/lib/plexmediaserver/Plex SQLite' --databases /mnt/user/appdata/Plex-Media-Server/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/ auto exit
docker start Plex-Media-Server
always learning new something everyday that could be a future feature in your program
if you get Start/Stop feature not available
then run
“docker stop Plex-Media-Server”
and then run the auto etc
“docker start Plex-Media-Server”
as a future request
always learning this linux stuff even though i started learning it more then 25 years ago i never cared for it then lol windows and dos was better for me lol
When in manual/user-defined mode like this, it will not know how to start/stop PMS because host detection and automatic configuration is disabled.
What you’re doing is correct for you:
docker stop Plex-Media-Server
./DBRepair.sh --sqlite '/var/lib/docker/btrfs/subvolumes/bfcc91107946fd8f5070a25a314cf86daf70e1b188a8e948a35bbbd137eb40f9/usr/lib/plexmediaserver/Plex SQLite' --databases /mnt/user/appdata/Plex-Media-Server/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/ auto exit
docker start Plex-Media-Server
@ChuckPa
ok sounds good least it will work now… i only noticed the issue after power out so wasnt sure…
ya had to google how docker stop started worked lol but hopefuly from here out no more issues Fingers crossed (:
learning something new everyday… its another thing if i can remember all this stuff later date lol
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.