Created
August 21, 2018 18:47
-
-
Save hthighway/d687a9fc07b2af55756e5a8aac94df12 to your computer and use it in GitHub Desktop.
Change file path for Plex Media
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This helped me cleanly port my server from docker to my Synology Diskstation (DSM 7) however I ran into issues updating
media_streams
, receiving the following error:Error: unknown tokenizer: collating
To properly update
media_streams
I had to usePlex Media Server
itself to run sqlite like so:The path on my DSM was
/volume1/@appstore/PlexMediaServer/Plex\ Media\ Server
.Hope this helps someone in the future.