# Database entry remains when deleting from DVR

**URL:** <https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300>\
**Category:** Live TV & DVR\
**Tags:** livetv-dvr, server-linux\
**Created:** [November 8, 2021, 1:02pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300 "2021-11-08T13:02:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![dennis\_de](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dennis\_de](https://forums.plex.tv/u/dennis_de)\
**Post date:** [November 8, 2021, 1:02pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/1 "2021-11-08T13:02:24Z")

</div>

Server Version#: 1.24.5.5173

When deleting a DVR, the corresponding entry in the media\_provider\_resources table is not deleted.

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [November 8, 2021, 1:12pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/2 "2021-11-08T13:12:26Z")

</div>

Empty the [library trash](https://support.plex.tv/articles/200392106-library-actions/), then perform a database optimization (Settings - Server - Manage - Troubleshooting).

Is the record still in the table after this?

---

<div class="post-metadata">

**Author:** ![dennis\_de](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dennis\_de](https://forums.plex.tv/u/dennis_de)\
**Post date:** [November 8, 2021, 1:29pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/3 "2021-11-08T13:29:30Z")

</div>

Thanks for your quick response. I just ran this again to be sure and the entry is still there.

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [November 8, 2021, 1:32pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/4 "2021-11-08T13:32:16Z")

</div>

Oh, I just re-read your first post above. You are deleting a DVR (tuner), not a recorded video, right?  
Yes, this is a known issue.

---

<div class="post-metadata">

**Author:** ![dennis\_de](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dennis\_de](https://forums.plex.tv/u/dennis_de)\
**Post date:** [November 8, 2021, 1:43pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/5 "2021-11-08T13:43:31Z")

</div>

I was wondering a lot. 🙂 Okay, thanks. Then I just delete it from the database via the console. I just thought I’d report it, since I hadn’t found anything about the error via the search.

---

<div class="post-metadata">

**Author:** ![mr\_cg](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mr\_cg](https://forums.plex.tv/u/mr_cg)\
**Post date:** [November 8, 2021, 1:47pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/6 "2021-11-08T13:47:03Z")

</div>

How to delete from the database via console?  
What are the relevant commands to delete/modify/add something in the database?  
Is there any wiki about this? Thanks

---

<div class="post-metadata">

**Author:** ![dennis\_de](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dennis\_de](https://forums.plex.tv/u/dennis_de)\
**Post date:** [November 8, 2021, 1:56pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/7 "2021-11-08T13:56:04Z")

</div>

I also delete the entry only because the curl error messages in the log get on my nerves. But it is not necessary for the operation.

I haven’t found a help article that describes this now but it works like this:

`/path/to/plex/Plex\ Media\ Server --sqlite "/path/to/your/database/com.plexapp.plugins.library.db" "<SQL Statement>"`

The entries are as described in the table “media\_provider\_resources” - you can show them with `"SELECT * FROM media_provider_resources"` - delete them with `"DELETE FROM media_provider_resources WHERE id = <id>"`.

**To be safe, make a backup beforehand and be sure of what you are doing. 🙂**

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [November 8, 2021, 1:57pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/8 "2021-11-08T13:57:34Z")

</div>

You need to determine the ID of the record you want to delete. If you place an incorrect syntax here, you could delete the wrong record (or in the unluckiest of cases the whole table).

---

<div class="post-metadata">

**Author:** ![mr\_cg](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mr\_cg](https://forums.plex.tv/u/mr_cg)\
**Post date:** [November 9, 2021, 9:44pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/9 "2021-11-09T21:44:24Z")

</div>

Sure, i know i need to be careful. Doing backup before is quite good idea. 😉

In case of automatic channel search problem … is it possible to add new DVR channels manually to DB if all channel parameters are known? This would be really very useful.

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [November 10, 2021, 7:42am UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/10 "2021-11-10T07:42:09Z")

</div>

Take a look at [Plex LiveTV&DVR - Senderliste für DVB-C Hamburg-Südholstein - #13 by OttoKerner](https://forums.plex.tv/t/plex-livetv-dvr-senderliste-fur-dvb-c-hamburg-sudholstein/204715/13)

---

<div class="post-metadata">

**Author:** ![mr\_cg](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mr\_cg](https://forums.plex.tv/u/mr_cg)\
**Post date:** [November 10, 2021, 6:00pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/11 "2021-11-10T18:00:06Z")

</div>

Maybe my description was somehow misleading.  
I did not mean the parameters for the channel search.  
The modification of the ini was already clear to me.

I mean … is it possible to add the channel parameters which are taken from Plex after channel has been found? If channel is found the parameters will be stored in the database (com.plexapp.plugins.library.db) using the table “media\_provider\_resources”.

The entry from found channels in the database look like this (example):

> \<Channel channelIdentifier=““triplet://1:1079:11170"” name=”“ZDFinfo HD”" origin=““Unknown”” param=“”\<?xml version="1.0" encoding="UTF-8"?\> \<tunedata\>\<tt\>2\</tt\>\<dq\>0\</dq\>\<dr/\>\<fr\>450000\</fr\>\<md\>0\</md\>\<sr\>6900000\</sr\>\<pl\>0\</pl\>\<lf\>7\</lf\>\<l1\>0\</l1\>\<l2\>0\</l2\>\<ls\>0\</ls\>\<pp\>0\</pp\>\<hz\>0\</hz\>\<in\>0\</in\>\<fc\>0\</fc\>\<t\>1079\</t\>\<n\>1\</n\>\<s\>11170\</s\>\<en\>0\</en\>\</tunedata\> “” drm=““0"” type=”“tv”" signalStrength=““51"” signalQuality=”“0"”/\>

My question was if there is any description about how to add this to the database including dependencies if needed?

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [November 10, 2021, 6:37pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/12 "2021-11-10T18:37:12Z")

</div>

Sorry, none that I know of.

---

<div class="post-metadata">

**Author:** ![MovieWiz](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@MovieWiz](https://forums.plex.tv/u/MovieWiz)\
**Post date:** [November 10, 2021, 11:50pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/13 "2021-11-10T23:50:42Z")

</div>

It seems that stuff about the DVR is being retained when you delete the DVR (such as channel mappings). Maybe that’s to make things convenient if you add the DVR back since, for example, channel scanning can take a long time.

But when people are having trouble because of this retention, perhaps, when deleting the DVR, people should be able to specify that everything related to the DVR be removed. This would certainly be more user friendly that having to go into the SQL shell and delete specific rows from specific tables.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [February 8, 2022, 11:51pm UTC](https://forums.plex.tv/t/database-entry-remains-when-deleting-from-dvr/756300/14 "2022-02-08T23:51:16Z")

</div>

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