How do I edit the History Table in Sonarr.db to remove records?

I am starting a new thread as the original went down a deep rabbit hole.
I am trying to remove all the records from that table from 30 days ago and beyond, or all of them like a reinstall would do. Currently there are over 11,000 records going back to 2019.
I believe, no matter what anyone says, is a liability issue for me. Again. No explanation why it wouldn’t be is irrelevant.

I tried using SQLite db browser and removed and vacuum’d them along with the downloaded files table.
That screwed up Sonarr where it had db malformed errors and sync issues with metadata. Anyone know how to successfully remove those records? Short of wiping and reinstalling Sonarr and manually adding all those 147 series back in so the history is gone.
-Bill

What exactly did you run?

DELETE FROM History should remove everything.

I did that and removed everything in the downloaded table too. I also did a vacuum. I had read the commit command wasn’t needed for single executions.
I just did this and the history is gone. YEAH!! I guess the downloadhistory are all still logged though.
If I zero out that table will it cause an issue? Its also got 11000+ downloads logged…

Keeping my fingers crossed. Thanks Again Markus.

Should be fine to do that one as well, so long as there aren’t any already imported downloads still left in the download client’s category.

Here is the Solution:
Run a Backup from inside the app.

Stop Sonarr Service

Make a copy of sonarr.db incase something goes wrong.
Its in the program data folder under Sonarr.

Open sonarr.db in SQLite Browser

Run DELETE FROM History
Run DELETE FROM DownloadHistory

Make sure to save the database when done.

Restart Sonarr Service.

Enjoy -Bill

My crazy history is Gone!

1 Like

Thanks much appreciated. I’ll have to fiddle around tomorrow cause I had the Podman media stack built for me and have to go through the docs for it to find it’s particular systemd service.