Server Version#: 1.14.1.5488 (synology)
Player Version#:
I’m preparing to move my server from my Synology NAS to a built Linux Ubuntu system with 4x10TB Raid-5 array. I’m just planning on manually copying all the media from their current location on the NAS to their new home on the Linux machine. Then referencing the article Move an Install to Another System move the “preferences.xml” file to the new PMS. My question is does this move all your settings such as Home Users, Sharing (users), Playlists, Metadata, Libraries (including changes I’ve made to my library manually such as multi-disc music albums, personal media without metadata and so on…), user data (such as played/unplayed) to the new server or must this all be started again from the beginning? Or is there a way to transfer this data?
Basically, is it possible to move an entire server to a new machine and have it look just like the old?
That will do it but, if I may suggest, Linux → Linux affords a much easier way.
Settings - Server - Library - Turn off both Empty Trash and Automatically update. You want PMS in fully manual library update mode during the move.
Stop PMS on the Syno.
Make certain you have R/W permission to the Plex share
Right click Library and Compress to Library.zip . This has just created a clone of the Synology
Install PMS on the Linux machine
Let it run once and then stop it. It only needs to create a couple directories
Copy the ZIP file into /var/lib/plexmediaserver
This part must be done from the command line, No gui shortcuts exist.
# get a root shell
sudo sh
# get into Plex's home directory
cd /var/lib/plexmediaserver
# Make sure it's stopped
systemctl stop plexmediaserver
# Rename the empty Library (created by the installer) out of the way
mv Library Library.enpty
# Unzip the Synology's ZIP file into position
unzip Library.zip
# Verify you have a both Library and Library.empty
ls
# Set ownership to this system's UID/GID for plex
chown -R plex:plex ./Library
# Start Plex
systemctl start plexmediaserver
Make certain your media is properly mounted in /etc/fstab at its permanent location
Return to your locally running PMS (on the Linux host). Do not use the Synology again. It has been cloned to Linux and will cause confusion if both run.
Now follow this procedure (moving media location) because, from this machine’s perspective, the media is no longer on /volume1/-something- . You’ve moved it to a new mount point.
When all is complete, you may delete the ZIP file and Library.keep.
You may also remove the Plex share from the Synology.
Keeping the user Plex is beneficial on the Synology for NFS permission purposes.
Wow… Let me start by saying I don’t have the Linux PMS in my possession yet. A buddy of mine is getting it set up (that’s above my know-how). This post was a preemptive strike at getting it running. That said, when I’ve messed with Linux before I quickly became intimidated as I’m rather weak (self taught) at the command line side. I’ve opted for Linux because it uses less system resources than windows leaving more for PMS to run. But this is also at a risk because I don’t know Linux, I’ve only messed with it. That said, a few questions and clarifications on your instructions so I don’t &*@! it all up…
The step:
Rename the empty Library (created by the installer) out of the way
mv Library Library.enpty
Is that supposed to be Library.enpty or empty? Not sure if that was a mistaken key stroke or if I’m renaming it as such to replace it with the new “Library”. Or if it even matters what it’s named because I think I’m deleting this in the end anyway (Question 5)…
After the first steps of transferring the library files is complete, the new Linux PMS will be using the media on the Syno Volume until I carry out the second part of moving my media and keeping the metadata, right? And that is the reason I’m not to run the PMS on the Syno because they’re both using the same media? And if that is the case, will the new Linux PMS have access to the Syno media through a standard Plex user ID per:
Keeping the user Plex is beneficial on the Synology for NFS permission purposes.
or will it ask for login credentials to the Syno?
Once this entire process is complete the new Linux PMS will be completely independent of the Syno. At that time is there still a problem with running the PMS on the Syno as a second server? My original intention was to use Syno’s Linux Drive app on the new Linux machine to initially transfer all the media and keep the two sets of media with the one on the Syno as a backup set of media and a second PMS (initially on the same network but eventually at a second location).
Do I still copy the preferences.xml file from my original post to the new Linux PMS?
Clarification:
When all is complete, you may delete the ZIP file and Library.keep.
You mean I may delete the Library.empty that I renamed, right?
Thanks for the help. I hope it all goes as easily and smoothly as your instructions…
Since you’ve now stated your post is preemptive, I need ask:
Where is the media? On your Syno or his? If your Syno but he is setting it up, did you loan it to him to do this? This is important because if it’s your Syno with your media, you’re better off setting it up without attempting to transfer from one to the other.
Linux is daunting at first but also VERY simple and consistent once you get the hang of it. Take your time and understand what and why you’re typing what you are.
To show you how easily this is done, regardless what the sourcec is, I’ve taken the liberty of transferring from my QNAP to my desktop. The process will be the same, only the minor details will differ if you are really transferring. This is why I ask. It’s a lot of work to do if you don’t need to do it.
Plex’s Library on my QNAP , with the Library.zip screenshot (QNAP’s are messy)
In this next screenshot, I’ve already downloaded that from the QNAP to my desktop’s “Downloads” directory. I’ve also escalated my privilege level to “root” so I can do anything I need without restriction.
Below I do the following:
cd to the Plex home directory (/var/lib/plexmediaserver)
Verify Library exists (it will)
Rename it (move) to be **Library.empty
Attempt to quiety unzip the ZIP file from my Downloads directory but bork the command (yes, I do it too haha)
Actually do get it to unzip as I want without warning
Get a detailed directory listing
Change the ownership of all files in Library to be owned by user plex on this system (every system assigns different user ID numbers)
I know it works so I remove Library.empty
One final directory listing
Confirm the space in use, providing me a Megabytes Summary (-ms) . Yep. 11GB)
Now I’m ready to start PMS and make changes to Folder locations. That’s the easy part. This is what scares most who are new to Linux.
PS: Total tiime to complete this, including writing up my reply and screenshots. 20 minutes.
I’ve had Syno’s since 2011. Presently a 916+ (with 2x6TB Red’s and 2x10TB Reds in SHR1). The Syno is mine and the media is mine. I am perfectly capable of setting up the Syno as I’ve owned several different ones over the years. However, over the years I’ve learned the limitations of Synology to effectively run a PMS, particularly when it comes to transcoding. My friend is in the IT business and has always been my supplier of computer equipment. I approached him on wanting a better setup for my PMS and I asked about either an Intel NUC networked to the Syno or a high powered QNAP. He suggested a ThinkServer w/a Xeon Processor he and his business partner had sitting in stock that they could set up with a 500GB SSD for the OS & PMS to run and 4x10TB HDD’s in a RAID5 for far less money than the QNAP also suggesting the NUC idea wouldn’t be as good of an idea as it would eat up network bandwidth and slow things down transferring the data between the NUC and the Syno (both are plugged in to a Syno RT2600ac). Since I was also running out of room on the 916+ this was the route I opted for. Although he could have put a licensed version of Windows on the machine I opted for Linux as it would use less system resources (not at all knowing what I was getting myself into never having touched Linux before. I’m perfectly capable with Synology’s DiskStation OS and Windows and would probably do just fine with QNAP. Knowing Syno was Linux based I was expecting an easier experience with Ubuntu). I got the Linux ThinkServer and quickly learned it’s GUI was nothing like what I was expecting (you actually responded to a thread where I was asking Questions before) and I FUBAR’d it so bad I had to send it back suggesting perhaps we put Windows on it. Now my friend is getting PMS installed and hopefully getting the permissions straightened out for me to make the transition easier so we’re trying to stick with Linux. Should be here soon…
All that explained, why would I be (or is your opinion the same that I would be) “better off setting it up without attempting to transfer from one to the other.?”
The steps you outlined all made pretty good sense to me on what I was doing. Where I FUBAR’d it all before was trying to adjust the permissions. Don’t know what I did but nothing was working right when I was done. All I was trying to do was give me and the Plex users full access to everything on the device, or at least the media folders that were first created/owned by me, not Plex. Is that possible? Because as I stated earlier my GOAL is to have Synology Drive running on the Linux ThinkServer syncing the media from the 916+ so new media will go onto the 916+ then it will automatically upload to the Linux ThinkServer. But the Synology Drive app would be running under my userid on the ThinkServer so permissions on the media was where I was having troubles the first time around. OR, is it possible just to login in and run the Linux ThinkServer (Synology Drive as well) under the Plex userid?
All that said, a question on your instructions, how do you escalate your privilege to “root” so you have all this access. I think this is where I jacked it all up before.
Users of your Plex server have no physical access to the server or your media.
2 Those users only have access to those Library sections you allow them.
This is all controlled through what you share with them and their Plex account.
You own the physical media on the Syno because you are the only one with a DSM login.
The only permissions you need to give PMS is to read that media. This permission is granted through the Control Panel - Shared Folders - Permissions tab when you Edit each media share.
In all cases, you own the media, free to modify or delete as you wish. PMS can only read.
If I may be bold, rather than a Xeon (which sounds fancy and mighty), unless you plan to setup a quad Xeon CPU system to server 50 people concurrently, the Xeon isn’t the right tool for the job.
I have an i7-7700 CPU. It can do every (6) display in my home (tablet - computer - TV) concurrently, converting HEVC 2160p HDR to H.264 1080p SDR (standard). The only limitation I run into is if I need to burn-in subtitles for more than 3 streams concurrently. This is because subtitles must be handled by the CPU. The hardware transcoding ASIC doesn’t support that capability (Intel didn’t provide one).
I am careful with my content. Text-based subtitles are 100% OK. Image based subtitles require burning regardless of the player’s settings. Therefore, I only maintain text subtitles for those languages I do not natively speak and don’t have an audio track I understand.
You mentioned the NUC.
I have a NUC. I love it. Get the NUC i7-7xxx processor as it is the best for video transcoding and the i7 is the strongest CPU in the NUC line. Load Ubuntu on it. Let it connect to the Synolody over NFS (the file sharing protocol native to Linux) and the task is done. You will run out of ethernet performance before the Syno fails to keep up. As I stated above, if you are not burning subtitles, and DirectPlaying your video, you will still run out of gigabit ethernet before you run out of anything else. That’s 40 streams of 20 Mbps sustained (based on standard ethernet/NFS overhead ). Will that do?
I’ll address the rest of your post in my next post. Is all this good so far?
I must have not been clear on the permissions thing… your responses 1-3 I fully understood and already knew. When I was referring to permissions (perhaps I used the wrong lingo) I was talking about file permissions within Linux Ubuntu between Plex and me as a user creating the folders & files then allowing Plex to read them. That’s where this whole mess started the first time around and I’m still trying to figure that one out.
On your fourth point, do you mean I can do this in Linux Ubuntu’s GUI or were you referring to Syno DiskStation? I can swear I tried this in Ubuntu with no luck. And my Syno has always run flawlessly, just not enough horsepower under the hood to do the transcoding.
Fifth point… Completely understood. Always knew that part. Guess I wasn’t clear in what I was trying to convey.
I appreciate your boldness and advice. I would have rather bought a QNAP with either the i7-7700 or the new one with the Ryzen 7-1700 (TS-1277-1700-64G)but this ThinkServer was offered to me for a couple hundred bucks (now I’m way more into it than that). I’m now regretting that decision for a multitude of reasons. Given the major headaches this ThinkServer has given me, it still may happen but have to save up for that one. That i7-7700 and Ryzen 7-1700 get almost identical scores, so which would you suggest if I were to go that way? And if I did moving the library over is the same process as we’ve been discussing sans the command line prompts, right?
I actually have a NUC too (Hades Canyon i7-8809G). But it’s my desktop PC running windows and while I’ve thought about just running PMS on it via the home network I really wanted a dedicated PMS.
Ah! Native Linux file permissions for you to create the files, place into the media directories, and PMS to read. Trivial and actually one and the same with my other reply
You have full control at the Linux level.
You are the only interactive user.
Plex is a system service ‘user’ without a login.
Just like on the NAS, we only need give Plex permission to read those files.
This level of permission control is basic Linux file permission stuff.
At the command Line:
The numbers are octal (base 8) notation for the binary bits to set.
Directories are assigned 755 (you have ‘rwx’ and everyone else gets ‘R-X’).
Files are assigned the same except you can’t “execute” a media file so 644 (RW-R–R—) Directories get ‘execute’ so you can traverse through them. Odd but that’s how it’s done
Through the GUI:
The Gnome GUI isn’t as robust as the Synology or QNAP GUI because it isn’t customized for large amounts of files but, by selecting multiple files/folders, you can achieve the same goal.
Since a picture is worth a thousand words, here is a snippet of how I have my media and directory permissions set. (the same 755/644 I stated above)
Haha… no worries… we can take it in as small of chunks as you’d like…
When I had the Linux machine here I tried adjusting the permissions using the GUI pictured above and it didn’t work. Tried to give all users read permissions. Nothing. Then read/write. Nothing. That said at this point I need to get the machine back to really get into it again… But I can say I got pretty lost when you started talking binary bits, base 8 and so on. I don’t have to give specific file permissions for each individual file, do I? Can’t I just give blanket permissions for a folder and it’s subfolders?
Regardless who the owner of the files on the drive are now, as root user set chuck:chuck as the owner.
Now that the files are under my name, tell find to find all the files of type directory and execute chmod 755 on each of them.
Repeat the find command except have it find all the files of type file (regular files) and execute chmod 644 on each of them.
All the media in that directory (a whole disk actually) is now set for Plex use.
To show you the power of this: I could just as easily have put multiple top level directories there or, if I really want crazy, the mount point for my entire NAS. It will grind through each and every entry it finds without fail.
Chuck, I got the Linux machine today. It’s up and running right next to my Synology with all the media in it. I’ve been reviewing the instructions above and have a question:
When I hopefully successfully get the library folder copied from the Syno to the Linux the new PMS in the Linux will be looking for the media in the /volume1/-mediafolders- which it will not have access to so the for each media title in PMS it will show “unavailable” outlined in red, right? Then when I add the location to the media copied from the Syno to the Linux machine it will show the “2”. Then once the original location /volume1/-mediafolders- is removed from the PMS Library in the Plex GUI, the “2” will disapear along with the “unavailable” highlighted in RED. Do I have this correct?
/etc/fstab NFS mount ip.addr.of.syno:/volume1 /volume1 nfs defaults,auto,rw,nofail,bg 0 0
Do the permissions in the NFS mount (/volume1) so plex:plex can read them over the NFS
sudo sh
cd /volume1
find media-dir1 media-dir2 (repeating as needed) -type d -exec chmod 755 {} \;
find media-dir1 media-dir2 (repeating as needed) -type f -exec chmod 644 {} \;
Now transfer the Library directory (This slides uphill )
sudo sh
systemctl stop plex
cd /var/lib/plexmediaserver
mv Library Library.unused
pushd /volume1/Plex
tar cf - ./Library | (cd /var/lib/plexmediaserver ; tar xf -)
Change the ownership from plex:users (Syno) to plex:plex (this host)
Because /volume1 is unused on 99.99% of Linux systems we mounted Synology’s /volume1 as our /volume1. Plex will find all the media right where it expect it
We added normal Linux permissions because Synology doesn’t use them. This makes your media accessible from the Linux host side. The Syno won’t care.
We then took your existing Library directory, made a tarball and shot it over a pipe to this system, un-tarring it right into place as it comes in. The result is “Clone” of the Syno.
At this point, once verified, the Synology’s Plex server will never need starting again.
Yea… you lost me right after, " If you would like to pull the ultimate hack"
I think what you just instructed me to do was leave the media on the Syno but run PMS on the Linux machine but using the media on the Syno, right? The Linux already has 4x10TB IronWolf drives in it in RAID5. My intent was to use Synology Drive for Ubuntu to sync the media beween the Syno-NAS and the Linux so I have two copies (just in case). BUT… now the Linux’s permissions are all set appropriately so I can write to the directories AND Plex:Plex can also have read/write priv on the Linux. I’ve confirmed that works. BUT the Synology Drive for Ubuntu App apparently DOES NOT have permissions to read/write to the RAID5 directory on the Ubuntu so that idea is SOL. Crazy thing is it worked before (the Syno Drive app on the Linux Machine).
I’m about to take this thing to the range and use it as a target. A very expensive target.
OK… guess I may have gotten a little too swoopy. DRATS!
Back to normal mode:
To move your media to the IronWolf drives and then rsync to the Syno (still cool )
Do all the appropriate copying.
Take the “Move PMS’ Library” procedure (link below) and use the Synology’s Plex/Library as the source. Your Linux box will be the new system.
Since you’re also changing media location, you’ll want my other piece (move data and keep the metadata)
To move PMS’ Library (or clone - which is what we’re doing here)
with one caveat. You can use ZIP from DSM. Any way to bring that file over to Linux will work.
(Backup on the Syno - Restore into /var/lib/plexmediaserver)
Pretty sure I understand all that which takes me back to my first question… when I move the library files to the new machine then ADD the new location, PMS on the new machine will not have access to the files in the original location at /volume1/-mediafolders- and will have “unavailable” highlighted in red for each media file UNTIL I complete the process of importing the new folder on the new machine, right? (I’m just checking my understanding of the process above)
And this still leaves me with a non-working RSYNC. That part is killing me right now because it DID work before…
Because Auto update is off and Empty Trash is off, They will be Unavailable until you edit the directory locations (Add new first, scan, see duplicate flag, remove old, scan again, watch dup disappearr)
Now if only I could figure out why I can’t sync the media… THIS PART is killing me… it worked fine before. Had the entire media collection at one time on this thing and the sync worked great every time I added something to the Syno’s volume.
What would the command line prompts be to allow the rsync app (Synology Drive) permission to read/write to the RAID5 directories? Or would that be beyond you scope of support?
sudo sh
mount -t nfs ip.addr.of.syno:/volume1 /mnt
cd /mnt
rsync -av ./media1 ./media2 ./media3 /raid5-top-level-directory
For my QNAP to mount the syno, which I’ve attached the NFS permissions for as well, looks like this:
This is what sync’s my QNAP → Syno. It deletes those files from the Syno which I’ve deleted from the QNAP. Editing the source paths, will allow you do send from your Linux box to the Syno.
#!/bin/sh
MountOpts="-o vers=4,rsize=524288,wsize=524288"
mount $MountOpts ${syno}:/volume1/cachedev2 /tmp/a
if [ $? -ne 0 ]; then
echo could not mount /tmp/a
exit 1
fi
Command="rsync -avh --delete"
# perform the backup / sync
cd /share/CACHEDEV2_DATA # entire HDD array
$Command 4k [A-Z]* [a-f]* [h-k]* /tmp/a &
$Command [m-s]* /tmp/b &
$Command [t-z]* /tmp/c &
rsync -ah --delete g* /tmp/a &
wait