Win to Ubuntu Server Migration

@ChuckPA

I’m wanting to move from Windows to Ubuntu. Basically, everything involving my Media Center is NAS and Linux based, except the Plex server itself, which is running on Windows Server 2016

I’m very familiar with both Win and Ubuntu OS’s, and currently run Ubuntu 20.04 Server for NZBGet, Sonarr, Radarr, Tautulli, QBittorrent, etc. So I don’t think the basic setup of Plex will be overly challenging, but as I would like to bring over my DB file from Windows (if possible) to keep the Viewing History and whatnot, I’m looking for advice.

I considered doing a docker install, but I think the complications involving hardware acceleration for transcoding would complicate things more than I’d like. So I plan to do just an Ubuntu 20 Server install (no GUI).

Here’s the basic Specs of my current server:

2X Physical CPUs (Intel Xeon CPU X5690 @ 3.47GHz, 6 Core(s), 12 Logical Processors (Total 24 cores)
Video - Nvidia 1050Ti 4GB 
Memory - 24GB
HD - 450GB SSD / 2TB HD
All Media is stored on a Synology NAS.
NAS LAN - Bind on 2-1GB Ports
Plex Server - Bind on a 4-port Broadcom NetExtreme GB LAN card
GB Switch
Internet - ATT GB Fiber - Up/Down 900ish
Router/Firewall (PFSense)

Existing Max Stream allowed setting in Plex server is 8MB per-stream, with 16 Max Streams.
My max load seems to be sometimes having 6-7 users viewing, and the current setup handles it well.  Normal load is 2-3 users viewing at a time.

I’m hoping that since I run NFS shares on my NAS, and the existing Ubuntu system, which runs all my media gathering / organizing apps, accesses the NAS shares via NFS mounts, that moving the Plex server to Ubuntu to also use the NFS share-mounts, that my Library Scans, Metadata Displaying, Displaying Libraries within Plex, Navigating to Recommended / Library / Collections, will be faster than via the current Windows server which is accessing the NAS over SMB shares. I often see several seconds of display before a list will appear, or on occasion I have to click Retry, as my library is very, very large.

Q1) Is there some way that I can ‘retire’ my old server name, before standing up the new one, or how is that handled on my Plex Pass account? Basically, I don’t want to cause issues with a previous OS/Install lingering out there containing the same Friendly Name for my Plex Server, causing possible Cert problems (as we’ve seen several people having lately).

Q2) If I do a clean install (no DB carry-over), will I have to re-invite everyone that currently uses my server?

Q3) Can the viewing history be exported and successfully imported from the existing Install/DB into a clean Plex install?

Q4) Does the NVidia Hardware Acceleration for Transcodes work correctly when running Plex on an Ubuntu Server without a GUI?

Q4) What would everyone recommend as a best practice for doing this install? I’ve seen a few forum posts across the web with sort of ‘Here’s what I did’ for moving from Win to Ubuntu and carrying over their DB, but it seems rather slipshod and messy. Is there a definitive guide?

Q5) If I bind Linux Plex via it’s Network Settings page, to ETH0, will it use this directly if I’m also running OpenVPN on the same box? Basically, will Plex route all traffic to ETH0 for direct internet access if selected on the Network settings page, or will I have to deal with some other form of fix to keep Plex from trying to route incoming/outgoing media traffic over the TUN0 VPN?

Q6) Should I expect Better, Same, or Worse performance on my server after the move?

Thanks for any feedback.

-DGC

A1.

You can retire one and have the new one take over by:

  1. Do all the prep work on the existing (turn off all the automatic library settings)
  2. Stop the server
  3. Make your snapshot (backup) of the installation which you’ll port over
  4. Start the server
  5. Change its friendly name
  6. With the new PMS stopped, remove the “Plex Media Server” directory (created during initial installation) on the new host.
  7. drop your data into its place (replace everything that was there)
  8. Remove all the “ID” fields from Preferences.xml prior to starting it the first time.
  9. Start the server

What you’ll find is:

  1. Old server has the new name
  2. Old server preserved all it’s shared users
  3. New server has old original Friendly name
  4. New server has no shared users, etc. – it’s pure in that regard.

A2.

Yes, if you do a fully clean install, you are truly starting from scratch because sharing is managed by the ID values and this new machine has new ID values.

A3.

You can export and re-import the view state from system to system with one restriction. Both servers must match using the same agent. Changing agent settings between servers will yield different index values and break the linkages

A4.

Yes, hardware transcoding on Linux with Nvidia does not require the GUI.

A5.

If you’re truly moving the installation across platform, don’t forget the major difference between Windows and Linux; CR/LF vs LF for EOL.

That CR will cause complete failure of the transplant.

You must remember to remove all the caches, Agent directories within PMS, and “Data” (not “Databases”) directory after deposited on Linux. The reason is because of text strings.

Windows has “This is a string” , Linux will see that as “This is a string<CR>”
This is why the caches get purged. All TheTVDB and TMDB data caches must go.

A5.

You can’t completely bind() all output traffic to a specific adapter.

You can tell the HTTP server which adapter to listen to (advertise) for all requests.
The default Linux route tables will redirect eth3 port 32400 traffic into PMS even though PMS’ default adapter might be set for eth0.

Once the traffic has entered the TCP/IP stack, it will be delivered.

A5 - part 2

VPN’s. In short - they are a PITA.

PMS uses UPNP and NAT/PMP to get the IP address assigned to the edge device because that’s what the vast majority of folks have to use with their families.

Can you craft all the route table entries to redirect all the traffic?
Why would you want a VPN when sharing with family & friends?
The traffic is SSL encrypted anyway.

A6.

What’s being measured?

  1. If OS efficiency is being measured - Linux wins
  2. Ease of maintenance is being measured - Windows wins.
  3. If functionality is being measures - Same.

@ChuckPA

A1 - Sounds like a Windows to Windows move. Is that correct?

A3 - You’re saying that If I have the agents setup on the new Plex install identical to the old Plex server (no matter if Win or Linux), It’s likely that the View state import should work correctly?

A5 - If I do a clean install on the Linux server, and then just bring over nothing but the Plex DB file, what can I expect to happen? I know I’ll have to add in the new paths for each library and remove the old paths, and let the system do an entire rescan of the library, but will this carry over the shared users, view history, etc? Any chance anything will be of benefit by doing this? Basically I would hate for all of my family to have to reflag everything as ‘watched’ again, or have to reinvite them all, etc.

A5 PT2 - I was hoping to move over all the duties of my current media acquisition / management server onto the same box as the Plex Server app, so that I could retire one entire machine. I currently run a VPN Client on this server since I use qBitorrent and so all of its traffic is done over the VPN TUN adapter, while I have the Usenet server connections and whatnot set to route directly instead of over the VPN. I was hoping I could do something similar with Plex’s traffic. But if it’s too much of a hassle, I guess I’ll have to stick with keeping the servers separate.

In the OpenVPN conf file, you can specify to route certain traffic outside of the VPN with simple lines like this:

route news.usenetserver.com 255.255.255.255 192.168.1.1
route news.frugalusenet.com 255.255.255.255 192.168.1.1
route usnews.blocknews.net 255.255.255.255 192.168.1.1

A6 - What is being measured is hopefully seeing better response when selecting my various libraries and getting their listings to appear. I’m assuming this is all related to the system’s ability to read the DB file. No idea if this would improve moving from Win to Linux with no changes in the actual hardware. Also, I was hoping that the Plex server app accessing the libraries media files themselves via NFS Mounts, instead of the current Win Plex server accessing SMB shares, would improve the response time of the Streaming Playback beginning, as well as jumping FF or RW in a video. I know that placing the Transcoding folder as /dev/shm should help somewhat.

Any additional feedback would be appreciated.

1 -

That’s Any to Any where you want to clone the data (which is what you’re doing).

3 -

Yes, Exactly what I’m saying.

5

If you don’t do the prep – anything can happen. You’ll probably get most of it but not a 100% guarantee. Be willing to redo a few times until you figure out the fine details.

5 - pt2

Can’t help you there.

6 –

If you want better Plex/Web page loading, use a SSD for PMS.

  1. No latency while the heads move
  2. Database fragmentation has minimal impact on SSD
  3. Data transfer rates either 535 MB/sec (SATA-3) or 2700 MB/sec (NVME) versus the 200 MB/sec maximum for spinning metal (7200 RPM)

@ChuckPa

For 1 - So a copy of the full Plex folder structure from an existing Windows install can be placed on a Linux install (after renaming or removing the clean install) and be expected to work?

I thank you very much for the reply, and it has the detail I was hoping for.

I will do an update when I complete the move, and we’ll see how it goes.

Here’s my follow-up:

All was successful.

My Win to Ubuntu 20.04 went off seemingly without any major hitch. I’ll still have to see if anyone complains about any oddities, as I did the move last night and so today is the first day of real-world testing. But all viewing history came over, etc.

I did have to go to each user and choose All Libraries since for whatever reason all of the users had no shared libraries after the move.

If anyone cares, here’s the two commands I performed to make sure the file permissions were correct:

First, after copying over all of your data from your old install, change to the PlexMediaServer folder and then issue the two following commands:

root@plex-pc:/var/lib/plexmediaserver# chown -R plex:plex ./*
root@plex-pc:/var/lib/plexmediaserver# find . -type d -exec chmod 0755 {} \;
root@plex-pc:/var/lib/plexmediaserver# find . -type f -exec chmod 0644 {} \;

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.