[HowTo] Plex database modification - Moving media the right/wrong way

Thanks a lot for this, I’ll drink a beer for you !

@jelwell said:
Ok, wow! That was surprisingly easy. Everything seems to be working GREAT!

So just so it’s clear. Following my instructions will likely mess up your Library. But it worked wonders for me. AND it is SO easy. Easier than following the nuanced instructions in that article I linked above.

  1. Shutdown plex server
  2. Backup your data https://support.plex.tv/hc/en-us/articles/201539237
  3. Copy your content to the new location
  4. Edit your database. Find the location here: https://support.plex.tv/hc/en-us/articles/201100678-Repair-a-Corrupt-Database

There are 4 edits you’ll need to make (change pathing to appropriate values):

UPDATE section_locations
SET root_path= replace(root_path, ‘/Users/jelwell/Shared’, ‘/Volumes/Movies’)
where root_path like ‘%/Users/jelwell/Shared%’


UPDATE metadata_items
SET guid= replace(guid, ‘file:///Users/jelwell/Shared’, ‘file:///Volumes/Movies’)
where guid like ‘%file:///Users/jelwell/Shared%’


UPDATE media_streams
SET url= replace(url, ‘file:///Users/jelwell/Shared’, ‘file:///Volumes/Movies’)
where url like ‘%file:///Users/jelwell/Shared%’


UPDATE media_parts
SET file= replace(file, ‘/Users/jelwell/Shared’, ‘/Volumes/Movies’)
where file like ‘%/Users/jelwell/Shared%’

5 Start up Plex Server
6 Verify that everything is working (test loading some of the copied files, note the location of that library changed in plex web settings)
7 Delete the old files.
8 Drink a beer for me.

@MovieFan.Plex might be worth adding to your tool?
Thanks everyone, I can’t believe how simple it is and how inaccurate that article is. Might be a good idea to just implement a move function in Plex Web…
Joseph Elwell.