Had to restore LMCE from an image that was about a month old, and of course there are now a load of mythtv recordings in the frontend for which the associated file doesn't exist (they were stored on another drive). If I try to delete them, they just reappear, mocking me.

What is the best way to remove these orphaned recordings from the database? I did find a very handy find_orphans.py script, but it is intended for 0.24. I tried to run it anyway, but it gave errors as apparently the bindings are not the same. I understand that the script can be modified for 0.23, but have read horror stories of it messing myth up big time.

So how do you all do it? This must have been an issue for somebody else before. Manually deleting the recordings from the hard drive would also give the same problem I guess.

Dealing with MythTV database inconsistencies is sometimes a pain, and usually takes some SQL skills.

The last time this happened to me, I seem to remember deleting all rows from a few tables to start over without losing my recording schedules. I believe there is also an older version of the orphan script - you can probably get it from MythTV's SVN. In either case - back up the database first so you don't screw yourself.

The MythTV database is pretty flexible, in my experience. You can usually dump it out and put it on a new system pretty easily. So long as you are going to the same MythTV version or newer, MythTV will accept the data without complaint. Just make sure you only deal with the media-related tables for recordings and schedules and such, otherwise LMCE will get confused. So next time you reinstall - just take the MythTV database with you.

I think that is really good advice, thank you. I will just put up with deleting them one by one for now (I've been doing a few every night for about 2 weeks now...), and I will look into backing up and restoring the MythTV database next time.

I've used that script on .18 .21 .22 and .23 I've never had a problem. Download .23 from mythtvs website and then use the myth.find_orphans.pl from that after you uncompress. It's in the /mythtv/contrib section somewhere. Maybe the newest version of the script has been modified

I've used that script on .18 .21 .22 and .23 I've never had a problem. Download .23 from mythtvs website and then use the myth.find_orphans.pl from that after you uncompress. It's in the /mythtv/contrib section somewhere. Maybe the newest version of the script has been modified

Can you please post your working script here so that perhaps we can perhaps include it somewhere?

I am working on putting a button in web admin under the "Delete ALL missing files from database". The first click runs the script to detect in an execute log window, then a popup confirmation should actually delete. I figure this is better than two separate buttons.

I don't know how people will hose their db in the future, and believe there should be a way to preview the changes before committing them.