Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change file path for Plex Media
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
5 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment