Moved plex from windows to linux with metadata. Media on Synology nas. Easier than it looked!

So, putting plex on CORE turned out to be not optimal if you want to stream anything above 1080. But hey, one not so great thing. That’s still a pretty good average.
Instead, I decided to move over to ESXI and spun up a vm for dietpi. Never heard of it? Well, it’s pretty cool. Light weight and totally bare bones, but has what you need. Here’s the link to it if you want to give it a try. Supports a lot of devices including virtual solutions. And it’s rock solid because it doesn’t have a bunch of bloatware to clutter things up.

DietPi - Lightweight justice for your SBC!

So, back to business. I spun up DietPi and used the built-in auto installer to run Plex Media Server. Couple of clicks and it was up and running. Install MC on the DietPi as well. Makes the file copy easier. Next is the hard part. Or what I thought was hard. And there were no good tutorials to do this.

So I needed to prepare my Synology for the connection. I believe that we can use nfs for backups as well, so you could translate some of this information over to apply this concept.

Check this link:

On the Synology:

  • Control Panel > File Services > SMB/AFP/NFS Tab

    • Click the checkbox for “Enable NFS” and click Apply
  • Control Panel > Shared Folder

    • Create a share for your media if you haven’t already
    • Click the share, then click Edit
  • Under the NFS permissions tab, I have these settings:

    • Client: the IP of my Plex server
    • Privilege: Read/Write
    • Squash: Map all users to admin
    • Security: sys (AUTH_SYS)
    • Checked: Enable asynchronous
    • The other two boxes I have unchecked

On DietPi

See Link:

You must stop plex media server in order to perform these steps on the DietPi. Also, turn off automatic empty trash in plex settings.

systemctl stop plexmediaserver.service

Create mount for PlexMovies (Movie storage folder)

Do not mess with punctuation other than removing [Share.Name] [synology.ip.address.here] after you replace the info with your own. Name use your existing shares or create them and name them accordingly. All other [ ] around the headers should remain

cat << EOF | sudo tee '/etc/systemd/system/mnt-[sharename].mount'
[Unit]
Description=Mount [ShareName] NFS share
After=network-online.target
Wants=network-online.target

[Mount]
What=[synology.ip.address.here]:/[share.path.here]
Where=/mnt/[Share.Name]
Options=auto
Type=nfs
TimeoutSec=60

[Install]
WantedBy=remote-fs.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable mnt-[Share.Name].mount
sudo systemctl start mnt-[Share.Name.Here].mount

Test your mount

sudo systemctl status mnt-[Share.Name].automount

TO EDIT THE MOUNT IF YOU TYPE THE WRONG PATH

sudo nano /etc/systemd/system/mnt-[Share.Name].mount

Create Automount for shared folders

cat << EOF | sudo tee '/etc/systemd/system/mnt-[Share.Name].automount'
[Unit]
Description=Auto Mount [Share.Name] NFS share
Requires=network-online.target
After=network-online.service

[Automount]
Where=/mnt/[Share.Name]
TimeoutIdleSec=10

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable mnt-[Share.Name].automount

If you are setting up mounts for more than one share, you need to run this for each share. You must update the share names and share paths where necessary.

STOP PLEX MEDIA SERVERS

From the old Plex Server (Windows)

Move everything in

%LOCALAPPDATA%\Plex Media Server\

TO

/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/

You’ll likely need to copy this file to the mounted share. That’s what I did and moved it using MC on the DietPi itself.


On DietPi

Putty in to DietPi and run MC (midnight commander) to move your file.
Here is a link to a good guide on MC
Navigate to your mount path on the left side and then tab over to the right side and navigate to your destination. Follow the guide on the bottom of MC to move the files.

After you’ve done that,
start up Plex,

systemctl start plexmediaserver.service

or reboot DietPi,
Sign in to plex web connected to DietPi and add your libraries. Done. Let it do it’s thing.

I left my old config in place until I confirmed everything was working. Don’t forget that you need to add library access for the shared and managed accounts.

If you find something that doesn’t make sense, please let me know. It was a long list to follow, and I could have very well missed a step.

1 Like