Plex Server crashes while optimizing DB

Server Version#: 1.29.1.6316
Player Version#: 4.87.2

i moved my plex installation to a new pc last year. since then i have a bad media library (see screenshot) which i can’t remove and this one let my plex server crash every time the db is optimized
2022-10-31 09_19_38-Window

i searched for repair commands but they didn’t help. how can i remove this bad library ?

Hi, it’s for docker and linux only. i’m running a windows server.

from a repair manual steps like recover or reindex fail:
C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-in Support\Databases>sqlite3.exe “C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db”
SQLite version 3.39.4 2022-09-29 15:55:41
Enter “.help” for usage hints.
sqlite> .recover
SQL error: unable to open database file
sqlite> PRAGMA integrity_check;
ok

Quite likely, your plex server was not shut down cleanly, or you made a copy of the plex data folder while the server was still running. Both can leave you with an unusable database file.

SQL error: unable to open database file

This message is telling you that the database is either completely absent, or damaged beyond repair.
You will have to go back to one of the backup copies: https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/

(But do perform the repair steps with this as well!)

the last backups have all the same status and the bad library because it’s since last year :frowning:

Then I’m afraid the only option is to start from scratch.

:frowning: that will be weeks of work to correct and assign the metadata.

It is crucial to act as swiftly as possible when there is suspicion of database damage. If you wait too long, this is what happens.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.