Moving folders to SSD, question

Server Version#: 1.23.1.4528

I’ve installed an SSD to house the Plex database, Metadata and Cache folders, transferred the data over and created symlinks to the new location, and it’s working.

My question is, should I also migrate the “Media/localhost” folder - that’s where all the bundles are stored - or should I have moved the entire “Library/” structure?

I know there’s a forum post on the moving of the whole thing, but I thought I could just move individual folders and symlink them, unless this is bad practice?

Just looking for some clarity from the gurus, thank you for all you do and your thoughts on this matter :slight_smile:

If you moved the entire structure,

  1. backups would be easier.
  2. the database, which is at the heart of what gets displayed on the page, is also on SSD. If the database is slow then everything is slow.

Ack! I forgot to include the “Plug-in Support\Database” folder was also part of the migration, so it’s on the SSD as well. I’ll modify the original post :slight_smile:

EDIT on second check, the database is actually in the original post :wink:

If you have moved the Cache folder, then it is likely the Transcode folder has also been moved (Cache\Transcode) and if this is on the SSD, you could actually wear out your SSD prematurely.

This has happened to quite a few people.

Unless you already know, the Cache\Transcode folder is written to very heavily with potentially thousands of little chunks of vids that are being transcoded, and it is this that could wear the SSD.

The best solution around this, would be to create a RAM Drive and then SymLink the Cache\Transcode folder to the RAM Drive.

Regarding the Transcoder directory,

I recommend setting the directory to use in Settings - Server - Transcoder - Show Advanced.

This way, you can point it to a HDD directory and keep it independent of the SSD

WITHOUT SYMLINK MAYHEM

1 Like

Ah, very good point. Thanks Chuck :smiley:

Actually, I’ve just remembered why I did it with a SymLink… Because conversions don’t follow the Settings > Transcoder > Transcoder temporary directory setting… Well, at least it didn’t a few years back!

My Transcode was already set to /dev/shm (in ram).
I think that’s the correct way to do it?

@axemanuk666

If you really want it to be solid,

  1. Set the environment variable - Preferred
  2. mount --bind (hardcore but removes all ambiguity as to where it’s going without symlinks)

Conversions do follow settings. A lot has happened in the past year alone.

Won’t the ENV variable only work if I move the entire /Library folder structure over?
I’m not sure where to apply mount --bind …

Setting PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR is the preferred method because it moves everything…

What you’re not aware of is that path-relative, symlinks exist in the Media and Metadata directory trees. If things get to carved up, symlinks won’t be valid.

Oh I see, so definitely I should:

  1. Stop PMS
  2. Move the contents of “/Library” to the SSD (the whole thing)
  3. Set the ENV variable to the new location
  4. Start PMS

Do I JUST move everything from “/Library” or should I move ALL of “/var/lib/plexmediaserver”?

I move the whole thing but only Library is what matters because we’re really after the Application Support directory (hence the name of the variable).

Taking Library means:

tar cf /path/to/Plexbackup.tar ./Library

is a whole lot easier to type & automate.

Ok, so let me spell this out, once more, because I’m foggy-brained today. lol.
The new SSD is mounted as “/mnt/plexdata”, so…

  1. Stop PMS.
  2. tar cf /mnt/plexdata/plexbackup.tar ./Library
  3. cd into /mnt/plexdata and tar xvf plexbackup.tar
  4. Verify permissions on extracted data
  5. set PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR = “/mnt/plexdata”
  6. Start PMS

Sound about right?

One addition.

sudo chown plex:plex /mnt/plexdata

(make sure the top level has permissions (think you have this already)

Yup, that was in there :wink:
Thank you for the patient clarification, I appreciate it!

One clarification, should I set the ENV variable inside my *nix box, or is there a place in Plex to put it (like the XML file, or will that get overwritten potentially)?

You change the PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR via the systemcl override mechanism.

  1. sudo mkdir /etc/systemd/system/plexmediaserver.service.d
  2. sudo <editor-of-choice> /etc/systemd/system/plexmediaserver.service.d/override.conf
  3. Add the following lines:
[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/path/to/new/Application Support"

You can add # comments if you wish.

  1. Save the file
  2. sudo systemctl daemon-reload
  3. sudo systemctl restart plexmediaserver

Details are here:

Sweet, and from now on I use “systemctl” instead of “service” to manage the PMS, correct? I believe that “service” is for init.d ?

Yes. systemctl is for Ubuntu 16+

There is a redirect in place but that won’t last forever.

I decided long ago to make the transition because there are times when I still have to work with init-based systems. This way helps retain my last bits of sanity.

If you’ll forgive the funky QNAP directory naming structure, here’s a bit of a trick – Reading and writing in one shot with no intermediate file… (if you are brave)

[/share/vtmp] # cd /share/CA*/.qpkg/Ple*
[/share/CACHEDEV2_DATA/.qpkg/PlexMediaServer] # 
[/share/CACHEDEV2_DATA/.qpkg/PlexMediaServer] # 
[/share/CACHEDEV2_DATA/.qpkg/PlexMediaServer] # ls Library/
Plex Media Server/  tmp/
[/share/CACHEDEV2_DATA/.qpkg/PlexMediaServer] # mkdir /share/CACHEDEV2_DATA/chuck-test
[/share/CACHEDEV2_DATA/.qpkg/PlexMediaServer] # tar cf - ./Library/ | (cd /share/CACHEDEV2_DATA/chuck-test/ ; tar xf -)
[/share/CACHEDEV2_DATA/.qpkg/PlexMediaServer] #