Plex: Find all unavailable files in database after partial data storage loss


This is for Mac OS X
Open the Plex Media Server database in a SQLite Editor

Run this query
SELECT metadata_item_views.grandparent_title, metadata_item_views.title, media_parts.file
FROM metadata_item_views
INNER JOIN metadata_items 
ON metadata_item_views.guid = metadata_items.guid 
INNER JOIN media_items 
ON media_items.metadata_item_id=metadata_items.id 
INNER JOIN media_parts 
ON media_items.id=media_parts.media_item_id 
/*WHERE metadata_item_views.library_section_id=2;*/
ORDER BY metadata_item_views.grandparent_title, metadata_item_views.title

Down, most, right corner click arrow and export to CSV and save file

Run that file through a e.g. Python script to check if the path and file actually
exists and return the Title of the missing media so it can be re-added again

You can view this article online at:
http://kb.herator.se/index.php/article/plex-find-all-unavailable-files-in-database-after-parti