@maccrory said:
Well - so much for restoring an older db version.
So it appears that the corruption was already present in the backup as well.
OR maybe: how much space is left on drive C:
? If it runs out of free space, the DB can get damaged really quick.
Instruct your anti-virus to leave the plex data folder alone.
If you have enough space free on C, we may need to perform the proper repair procedure after all.
There are 2 lines more now, compared with the instructions in the help article.
Do you still have the backup of the database we made yesterday? Let’s start with this one.
Shut down Plex Server before doing any of the below:
sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort'"
sqlite3 com.plexapp.plugins.library.db "DELETE from schema_migrations where version='20180501000000'"
It is of utmost importance, that the above commands are copied exactly as written, because they alter the database directly.
Now run the integrity checks
sqlite3 com.plexapp.plugins.library.db "PRAGMA integrity_check"
And then attempt repair
export the DB to SQL file:
sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
Now rename the original, corrupted DB file
Linux/Mac: mv com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
Windows: rename com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
reimport the SQL dump back into a new DB file:
sqlite3 com.plexapp.plugins.library.db < dump.sql
Run another check to establish if repair was successful
sqlite3 com.plexapp.plugins.library.db "PRAGMA integrity_check"
at the end of the procedure, move these 3 files out to a safe place (outside of Plex’s data), just in case you want to revert it:
com.plexapp.plugins.library.db-shm
com.plexapp.plugins.library.db-wal
com.plexapp.plugins.library.db.original