Move DVR media

Server Version#: 1.26.0.5715
Player Version#: n/a

I had to move my media from one drive to another. I have empty trash automatically disabled. When doing the move, I slightly changed the directory structure. I updated the path of the libraries; however Plex is showing all my DVR content as unavailable.

For example, on one library…
Old path: “L:\Libraries\Media\Videos\DVR\TV Sports”
New path: “L:\Media\Videos\DVR\TV Sports”

This was updated in the library path settings. Scan library, nothing picked up.

Copied files back to the old path. Scan library, nothing picked up, everything still shown as unavailable; HOWEVER plex will play the media.

I can add new content to the new path and plex picks it up during a scan.

Any procedure for moving DVR media? I’m fine with digging into the database if I have to.

Solved this by screwing with the database.

First editing the media_parts table following instructions here: [HowTo] Plex database modification - Moving media the right/wrong way - #10 by jelwell

I didn’t have to do any of the other 4 updates in that post (I already manually updated the library paths and the others didn’t apply).

Then I had to NULL out the deleted_at values in the media_parts AND media_items tables.

No idea why scanning the library didn’t un-delete the files after it “should have” found them again. Maybe a bug in the server?

Edit: This took a little bit more screwing around as after a little bit the libraries with the DVRed items became completely corrupted. Good thing I copied the DB before doing anything.

I think this resolves it, starting from the original database. I ran the following commands with current directory where the database is stored (have a backup).

"C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe" -sqlite "com.plexapp.plugins.library.db" "UPDATE metadata_items SET deleted_at= NULL"

"C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe" -sqlite "com.plexapp.plugins.library.db" "UPDATE media_items SET deleted_at= NULL"

"C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe" -sqlite "com.plexapp.plugins.library.db" "UPDATE media_parts SET deleted_at= NULL"

"C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe" -sqlite "com.plexapp.plugins.library.db" "UPDATE media_parts SET file= replace(file, 'L:\Libraries\Media\Videos\DVR\', 'L:\Media\Videos\DVR\') where file like '%L:\Libraries\Media\Videos\DVR\%'"

In the final command you’ll need to replace your original and new paths accordingly.

Basically this edit is the same as the original but I also had to NULL the deleted_at values in the metadata_items table. I ended up using the plex -sqlite command to do this because of a tokenizer error when attempting in DB Browser for SQLLite. This comment pointed me in the right direction (Can no longer update library database with sqlite3 - #30 by bpalloni).

I will update this again if I have further issues, but I feel confident this is resolved this time.

I must have missed something because after scanning the media is showing the trash can icon again… but can still play the items.

Doesn’t show unavailable in the get info page.

Found this similar issue, with the solution being to do the plex dance, but plex dance won’t work on DVR content.

bump 1

bump 2

bump 3

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