Moving Plex from Ubuntu Desktop to Synology 918+

Server Version#:1 .20.1.3252
Player Version#:n/a

I’ve got a shiny new Synology 918+, and I’m excited to get Plex installed and up and running on it. I’ve gone through the restore process with a .tar.gz of my media files and the Library/database a few times before, but always Ubuntu -> Ubuntu.

I’m also new to Synology / NAS in general.

What’s easiest? I have my media, and the library folder (everything in
$PLEX_HOME/Library/Application Support/Plex Media Server/) backed up as .tar.gz files, on an external hard drive.

Can I just do what I’d normally to to restore Plex on the Synology server? Or is it more complicated than that? I’d really like to preserve the database – I’ve put a ton of curatorial work into it.

Thanks for your help, Trumpy. I have questions!

In Step 1, when I install Plex using Package Control on the Synology server, there’s a point where I have to give the new server a “friendly” name.
It’s not clear whether I should give the new server the same “friendly” name as the old server. The old server was simply called “plex”. It would be helpful for the new server to have a different name (“Synology Plex,” or “plex2”, etc.) to distinguish it from the original server. Does the new server have to have the same “friendly” name as the old server for the transferred database files to connect correctly?

In Step 3, it’s not clear where I should create the media folder, and if by “keep folder organisation the same” that means I can create a new folder with my media in it in Shared Libraries or if I have to try to create the original Ubuntu path from root (/home/plex/plexmedia etc.). I chose to create a Shared Library because that way I can map to the drive from my main computer (Windows), and direct file access is useful. Synology doesn’t make it easy to access the filesystem.

I have created a new Shared Library, and a subfolder called “media,” and in “media” I have copied all my Old machine media files in the same folders (Music, Movies, TV) over. Is that correct?

In Step 4, is it better to delete all contents of Plex Media Server and move the contents of the Old machine into this now-empty New machine folder, or copy and paste the contents of the Old Plex Media Server folder into the New Plex Media Server folder, selecting “Merge” and “Replace” and “all matching files” when prompted in Ubuntu?

In Step 4, does it matter if Plex is running on the Old machine while I move the files over? Do I need to stop Plex on the Old machine and the New machine while the files transfer?

Thanks for those answers. I’ve logged every step I’ve taken to try to make this work, and would appreciate any help that can be provided.

The machine name of the Synology server is “plexbox.”
The shared file folder for my media and other files is “49cherry”.

a. moved all media to a shared library folder (49cherry/media/TV, Movies, Music)
b. installed Plex on Synology unit using Package Center
c. clicked “Open” on Plex Media Server once installed
d. clicked through How Plex Works (“Got It!”)
e. gave it a friendly name (“depth hamster”)
- left “Allow me to access my media…” checked
f. skipped adding libraries
g. skipped Get Plex Apps (Done)
h. Plex Settings > Server > Library > Show Advanced
Unselected:
- Scan my library automatically
- Run a partial scan when changes are detected
- Scan my library periodically
- Empty trash automatically after every scan.
Clicked on Save Changes
i. The “depth hamster” Plex install says “This library is currently empty.”
j. Exited the browser
k. In Package Control, opened Plex Media Server
l. In the dropdown next to Open, clicked “Stop”
m. Plex Media Server is “Stopped” (button now says “Run”)
n. Started the Ubuntu computer Old Plex is on
o. Ensured Plex is not running (sudo service plexmediaserver stop)
p. Opened Synology Assistant to connect to the Synology unit on the Ubuntu computer
q. Connected to the Synology unit
r. In the file explorer (File), connected to the Synology unit (“Other Locations”)
- used the admin username and password to log in
s. Navigated to the Plex Shared Files folder on the Synology unit
t. Navigated to the Plex / Library / Application Support folder on the Synology unit
u. Opened a second File window
v. Navigated to /var/lib/plexmediaserver/Library/Application Support in the second File window
w. Dragged the Plex Media Server folder from /var/lib/plexmediaserver/Library/Application Support on the Ubuntu (Old Plex) computer to Plex / Library / Application Support on the Synology unit, to copy over the old Plex Media Server folder on the Synology unit
x. Files begin to copy (~579,000 files)
y. When prompted in Ubuntu, select “Merge” and “Apply this action to all files and folders.”
z. When prompted in Ubuntu, select “Replace” and “Apply this action to all files and folders.”

aa. During the process, files matching a formula similar to ___.agents.local.[very long string of letters and numbers] could not be copied, with the error message “symlinks not supported by the backend.” After manually skipping 200 of these files, I hit “Skip All.” Does this account for a ~70,000 file and 3 GB discrepancy later in the process (see below)?

bb. Wait for files to finish copying (est ~2.5 hours total at 5:30 p.m.)

cc. As the files transfer, the display indicates ________ / _______ files remaining. Unusually, the right side of the display seems to count down as the left side counts up, so if it’s 333,333 files out of 444,444 files one minute, it might be 350,000 out of 400,000 files later. This is unusual, in my experience – it’s more normal for the total files to remain unchanged. The rate of numbers dropping on the right does NOT correlate to the rate of rise of the numbers on the left – the “files transferred” count goes up much faster than the “files remaining” side goes down.

dd. The right-side count eventually stabilizes at 451,168 files remaining. Shortly after, it drops to 450,860 files remaining and stabilizes there again. It periodically drops a few files on the right, then stabilizes for another minute or so. “6 minutes remaining” for 30+ minutes. We slowly move past Hour Four.

ee. Eventually, the left side number meets the right side number… at this point, the left side number keeps climbing so that the files transferred number is greater than the files TO transfer number. The estimated time remaining vanishes. The right number still periodically drops; the message on the window reads “_____ files transferred” and drops to match the number on the right, regardless of the actual transferred files count on the left.

ff. 4.5 hours after the copy starts, the numbers stop: 506,131 / 447, 018 files transferred. The “X” to cancel the transfer turns into a checkmark, but the pie chart showing the total transfer still has a sliver left out of it. The drive lights on the Synology are steady, showing no flickering for drive activity. I leave it alone for 15 minutes, with no changes.

gg. Right-click on both Plex Media Server folders for Properties shows the Ubuntu (Old Plex) folder at 578,767 items and 30.1 GB. Right-click on the Synology Plex Media Server gives me 506,131 items and 28.8 GB. At this point, it’s well past when I should be asleep, so I shut down the Ubuntu computer (Old Plex) and go to bed.

hh. The next morning: navigating through the File Station, I delete Preferences.xml from the Synology Plex files in Plex / Library / Application Support folder on the Synology unit

ii. I Run Plex on the Synology unit by opening up the Synology interface on my computer, navigating to the Package Center, opening the Plex Media Server package, and clicking “Run.”

jj. I open Plex by opening a browser and going to app.plex.tv, logging in with my username and password. The server “depth hamster” (the name of the new server, on the Synology unit) appears on the left, with an exclamation mark on the icon.

kk. When I click on the depth hamster server entry, it says “depth hamster is currently unavailable. Verify you have a network connection and that the server is online, or see our troubleshoot tips for further assistance.”

ll. I verify that the Synology unit is running by returning to the Synology DiskStation on my browser and browsing in the File Station. It is running.

mm. I return to Plex and click “Retry Connection.” Nothing happens. I click “Retry Connection” several times with no effect. I close the browser tab running app.plex.tv.

nn. Returning to Synology DiskStation, Package Center, Plex Media Server, I try “Open” in the Plex Media Server entry in the Package Center.

oo. Clicking “Open” in the Plex Media Server entry in the Package Center returns me to the earlier Plex initiation screen (“How Plex Works”). I click “Got It!”

pp. It moves to the Server Setup page. It does not seem to know there is a server name. It prompts me to enter a friendly name. I enter “hamster depth” to distinguish this attempt from the earlier attempt, “depth hamster”. I leave “Allow me to access my media outside my home” selected. I click “Next.”

qq. On the second Server Setup screen, it gives me an “Organise your media” option to add a library. This does not correlate to steps 6-8, where I should have libraries that I need to relink with “Plex Settings > Server > Libraries (bottom left) move the mouse over the name of your library and click on Edit. Go to the Add Folders tab and add the new file path for your library. Keep the old paths for now. Click on Save Changes. Repeat for all libraries.”

rr. I opt to not add libraries now and click “Next”. My concern is that adding libraries might wipe the database entries for old libraries in the copied files.

ss. A third “Server Setup” screen, inviting me to “Get Plex Apps.” The below message says “All set! Your Plex Media Server is working hard to find your media and make it beautiful. Grab the Plex app for all your favourite devices to get the most out of Plex and start streaming everywhere!” I click “Done”.

tt. I am in the Plex server, in “Home.” The screen reads “Your home screen is empty. If this is unexpected, see our . If you removed everything and want it all back, choosing Reset Customisation below will reset your sidebar navigation and home screen layout to the default state.”

uu. When I click “Settings,” on the left side of the screen, there are two possible servers: “Plex” (the Old Ubuntu Plex installation), and “depth hamster” (the “friendly” name I entered during the initial installation last night, before transferring the files, in step 1.) Both servers are unavailable (the Ubuntu computer with Old Plex is turned off. “depth hamster” is also “unavailable.”). The new “friendly” name I have just entered, “hamster depth”, is not on the list of potential servers. There are no Settings options other than displaying a list of unavailable servers.

vv. Revisiting File Station, I see that “Preferences.xml” has reappeared, created at around the same time I clicked “Run” on the Plex server this morning.

ww. The Preferences.xml file includes FriendlyName=“hamster depth” in it; the name I created this morning.

xx. I return to the Plex main screen and click “Home” and then “More”. I can now see that “Hamster Depth” appears on the left, with a “Playlists” entry and nothing else underneath it. When I click on it, the screen reads “No soup for you! You do not have access to this server.”

yy. I close the Plex tab, and “Stop” plex in Synology DiskStation, Package Center, Plex Media Server.

zz. I delete Preferences.xml again.

aaa. With Preferences.xml deleted, I re-start the Plex server (“Run”) in Synology DiskStation, Package Center, Plex Media Server.

bbb. I click Open in Synology DiskStation, Package Center, Plex Media Server.

ccc. Moving through the Server Setup again, I give the server yet another “friendly” name (“bad kitty”).

ddd. This time, I elect to “Add library.”

eee. In the “Add Library” popup window, the orange swoosh circles for a very long time.

fff. After 20 minutes of letting it “think”, I click “Cancel.”

ggg. I stop, restart, and Open Plex again from the Package Center. I now have four servers: Bad Kitty (just created), Hamster Depth (the formerly created friendly name), “Plex” (the Old Plex Server on the Ubuntu computer) and, bafflingly, “Plexbox”, which is the machine name of the Synology server.

hhh. In the BAD KITTY server, I have the “No soup for you!” message.

iii. In the HAMSTER DEPTH server, I have a “Currently Unavailable” message.

jjj. In the PLEX server, I have a “Currently Unavailable” message.

hhh. In the PLEXBOX server, I have a “Currently Unavailable” message.

Any further help will be appreciated!

Following up on the above, my feeling is that deleting the Plex package in the Package Center, deleting the Plex Shared Folder on Synology, and starting over from scratch, trying a different way to move the old Plex Media Server files from Old Plex to Synology, might be the best way forward. Or saying f&^%$ it to all the database customization and just installing Plex without trying to import the old database. It would break my heart, but I’ve invested ~12 hours here and I need to cut bait at some point.

If I may jump in?

Catch me up please? (

You have a tar.gz which you created by (effectively) ?

cd /var/lib/plexmediaserver
tar cfz path-to-file.tar.gz  ./Library

Does the Ubuntu system installation still exist ?

Hi Chuck,

Following the step-by-step instructions above, I opted not to go through the additional complexity of moving and unpacking the tar.gz on the Synology server and just drag-and-dropped the Plex Media Server folder from the old machine (Ubuntu) onto the new machine (Synology). As you can see above, it was a weird experience.

I do have that tar, which I created on a backup drive before starting this whole process as a backup, just in case.

The Ubuntu system installation is still in place and fully functional; I just turned the machine off to avoid confusion after moving the files to the new Synology system.

I’ve started over, and this time after setting up Plex on the Synology server, unchecking the Libraries command and shutting down Plex, I’ve decided to try moving the database files without using drag-and-drop in Files.

I tried to mount the Synology drive from the Ubuntu box by using these instructions ( ), mounting the Synology Plex directory at /mount/NAS, navigating to /var/lib/plexmediaserver/ and using the command cp -a . /media/NAS to copy and overwrite “Library” on the Ubuntu box (old Plex) on top of the “Library” folder on the Synology server.

I get the following error:

cp: failed to preserve ownership for [file path and name]: Operation not permitted.

Both file systems are ext4; I can’t figure this out by searching that error, so next I’m going to try a .tar.gz of the Library folder to the mounted Plex shared file folder on the Synology server and try to unpack it over the existing Library folder.

It seems like the “move files from the old server to the new server” step is the key issue here, from my POV.

In the interest of continuing this saga, if nothing else…

I carried on by creating a .tar.gz of the /var/lib/plexmediaserver contents (the Library folder) and moved that via the mounted share to the Synology drive. I then unpacked Library.tar.gz (creating Library.tar) in the File Manager, and unpacked Library.tar in the folder, (theoretically) overwriting the Synology Plex Library folder with the Ubuntu Library folder. I then renamed Preferences.xml to Preferences.old.xml.

When I try to Run Plex now via the Package Center, it thinks for a minute, then pops up a warning saying “Failed to run the package service.”

I deleted the .tar.gz and .tar files, just in case, but it still gives me the “Failed to run the package service” notice.

Did you open the Plex share,
Right-click on “Library”
Go to the ownership tab
Make certain it’s owner is Plex
and you checked the box “Apply to this folder, sub-folders, and files”
then applied it.

The general sequence (in Linux terms)

  1. Extract
  2. Chown to match the new UID/GID (plex:users)
  3. Start

Thanks to both of you, I appreciate the time you’re taking to help me with this.

I don’t see an ownership tab in the Synology File Station / Plex shared folder when I right-click Library, but Properties and Permissions lets me add “plex” as an owner of that folder, with Full Control, and apply that recursively, which I’ve done.

Once the plex user had Full Control over the Library folder, I stopped getting the “Failed to run the package server” and Plex started running.

Now, however, when I open Plex it takes me through the initial setup again. I click through, and now I have two versions of the same server, both not working. This happens whether I open Plex through Package Control in Synology, or whether I open it via app.plex.tv.

Here’s my home screen:

“badkitty” was the friendly name I gave the Plex server this go-round. It’s now duplicated, I imagine because I was forced to go back through setup again, and chose the same friendly name again.

“Plex” is the old plex server on Ubuntu. The computer is on, but the plexmediaserver service is stopped.

The lower item is a friend’s Plex server that I have access to. Possibly useful to show that Plex is working, even if my own servers are not.

The top “badkitty”:

The second “badkitty”:

Plex → Library → right-click → Properties

Thanks, Chuck – I moved from Properties to Permissions and didn’t even notice the “Owner” section at the bottom of the General tab.

That seems to have done it! I can access one of the badkitty Plex servers (there are now four, for some reason), and while it’s showing everything with a trash can on it, I think that’s temporary.

All this and I screwed up the sequence at the top and REPLACED the library paths without adding to them and deleting the original paths after the media was found… so I may be hitting another redo tomorrow, but now I know to set the Library folder owner after updating the files.

You will get Red trash cans at first.
Add the new path – a “2” appears as the trash cans are removed.
After that section is complete – delete the old path
The “2” disappears.

Wash-rinse-repeat for each section.

This sequence preserves the watch/viewing history

Still a lot of things missing – artist art in music, album art, formerly consolidated music albums re-split, etc. At a guess it looks like it’s ignored all the DB files and rebuilt a new DB from scratch on top of the old one.

At this point, I think I’m going to throw in the towel. I’ve spent ~12 hours trying to do this, and it probably would have taken about the same amount of time just restoring the customizations I’ve already done.

I’ve deleted the Plex package, plex user, and Plex shared folder; I’m going to try to start a Synology install and just redo all the customization work.

If somebody has time and wants to attempt it, clearly there’s some steps in the instructions wayyyyy up top here that could be clarified for people who aren’t Plex/Synology/Ubuntu power users (people like me) – how to move files from the old Plex server to the new Synology server and set permissions correctly, and so on.

For now, I’m cutting bait. Thank you for trying to help, but this obviously takes a level of skill that I lack.

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