Moving to Synology NAS?

I currently have Plex Server running on my Mac Mini server and all the media files on drives directly attached to said Mac Mini via USB.

Due to the need for more space, I am getting a Synology DS1815+ NAS and I want to move my library of files AND PMS to the NAS. I have read both articles on how to move the library and how to move PMS, but I am wondering if there is a more convenient way of doing both first moving the library and then moving PMS.

Second is there an easy way of converting preference files going from the Mac to the NAS (Linux based) or will I be stuck at manually converting the items myself using a good ole text editor? Or do I need to bother? Having looked at the com.plex.mediaserver.plist on the Mac, I don’t really see anything that isn’t easily recreated by just going through the settings in PMS itself.

Basically the only thing I care about is the watched status of my movies and series, everything else is just setup as far as I am concerned.

Do I really need to first migrate the Mac to the NAS, then install PMS on the NAS, move the PMS folder from the Mac to the NAS in the appropriate location and then migrate the library again to change from network shares to local drives? Seems like a lot of work. :slight_smile:

Advise appreciated.

Did some digging and a lot of asking for you. This isn’t easy coming from a Mac, but doable.

To convert the now-binary plist file to XML (which you need the MachineID and ProcessedMachineID from) as part of the identity move, here’s how you get .plist to-from xml.

The key pieces of information to get from the XML (which will be “TextEdit”-able) are the MachineID and the ProcessedMachineID. Using the utility above, extract and keep these ID numbers. This is what you will edit in later.

— More information coming. key people in meetings –

You might want to read this thread in the interim

Cheers Chuck, I appreciate you taking the time to go through the trouble of helping me figuring this out.

@Mo’Gas,

I’ve not yet heard back but the rest of the puzzle, and KEY piece to retaining your watched/unwatched status is the database itself, highlighted below. Moving from dissimilar systems is a pain but here we go. grabs hand rails and hangs on :smiley:

side note: I am performing setups here to allow me to do better support of macs but Vbox isn't ready yet

[chuck@lizum Databases.90]$ pwd
/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases
[chuck@lizum Databases.91]$ ll
total 912888
drwxr-xr-x. 2 plex plex 4096 May 26 02:02 ./
drwxr-xr-x. 7 plex plex 4096 Mar 23 20:37 
/
-rw-r–r–. 1 plex plex 20480 Mar 23 20:37 com.plexapp.dlna.db
-rw-r–r–. 1 plex plex 32768 Mar 23 20:37 com.plexapp.dlna.db-shm
-rw-r–r–. 1 plex plex 83872 Mar 23 20:37 com.plexapp.dlna.db-wal
-rw-r--r--. 1 plex plex 155992064 May 27 08:15 com.plexapp.plugins.library.db
-rw-r–r–. 1 plex plex 153868288 May 17 02:02 com.plexapp.plugins.library.db-2016-05-17
-rw-r–r–. 1 plex plex 153269248 May 20 03:40 com.plexapp.plugins.library.db-2016-05-20
-rw-r–r–. 1 plex plex 154557440 May 23 02:01 com.plexapp.plugins.library.db-2016-05-23
-rw-r–r–. 1 plex plex 157068288 May 26 02:02 com.plexapp.plugins.library.db-2016-05-26
-rw-r–r–. 1 plex plex 1212416 May 27 09:58 com.plexapp.plugins.library.db-shm
-rw-r–r–. 1 plex plex 158657800 May 27 09:57 com.plexapp.plugins.library.db-wal
[chuck@lizum Databases.92]$

The -shm and -wal files are left behind. The DB files with dates are the Plex-generated automatic backups (bring them along too). Whatever you do, keep a safe copy of the databases until later. They hold all the information.

In thinking through this myself,

  1. After copying the media to the DS1815+, add the DS1815+ shares to their respective library sections in your Mac PMS installation.
  2. Update your library. You will now see you have duplicates of your media. This is desired.
  3. In Settings - Server - Library, uncheck all the boxes (full manual mode). Save the changes
  4. Shutdown PMS
  5. Export your plist → xml and set that aside. you’ll need it after starting up Plex on the Syno

You’re now ready to capture all the metadata itself and take that with you. I’m not certain where this info is but for me is under /var/lib/plexmediaserver/Library/Application Support/Plex Media Server

I normally create the transfer tarball, which gets everything, using:

cd /var/lib/plexmediaserver
tar cf /some-place-for-xfer-tarball.tar  ./Library

Copy the tarball onto a NAS share and complete the transfer from the shell

With PMS shut down on your 1815+,

ssh `your-nas`
sudo -su root
cd /volume1/Plex
mv Library Library-prev   (if Library already exists)
tar xf /location/of/xfer-tarball.tar
chown -R plex:plex ./Library

cd "Library/Application Support/Plex Media Server/Plug-in Support/Databases"
rm -f *-wal *-shm
cp /path/to/saved/databases/com.plexapp.plugins.library.db .

Again, make sure plex:plex owns the db file. chown plex:plex com.plexapp.plugins.library.db

You can also, just as easily, create a ‘zip’ file, copy it to to the 1815+ and ‘unzip in place’ in the Plex share (if you can see the Plex share (some systems don’t see it while others do). After you do, make sure ‘plex:plex’ owns all the files. This is imporant because Plex runs as an unprivileged user, not ‘root’. It needs to own all its files. Go in via the shell as shown above and perform the chown step.

You won’t have a Preferences.xml yet but Plex will create a default for you on the Synology

You should now be ready to start Plex on your Synology. Your libraries will be visible but content not likely to show because the data is there waiting to get the locations updated.

  1. Make sure you’ve given Plex access to your media shares (Control Panel - Shared Folders - Edit)

  2. After starting, Settings - Server - Library.

  3. Make certain everything is still FULL MANUAL

  4. For each defined library section:

    Edit the library and   add the new /volume1 location to your media, leaving the others for now
    Save this edit.
    Update this, and only this, Library.   You should be rewarded with seeing your metadata repopulate at a very quick rate.
    
  5. Check you watched / unwatched status. If good, continue. If not, stop; pull the Plex Media Server log files (all 6), zip them, and attach them in a post here.

  6. If successful, continue until all library sections have updated locations.

  7. Perform a final update on all Library sections.

  8. In Settings - Server - Library , put everything back to how you had it.

At this point, Plex will have been migrated with exception of the machine’s identity (which you captured from the plist

  1. Stop Plex

  2. Either through the shell or the File Station, get down into /volume1/Plex/Library/Application Support/Plex Media Server

  3. Edit Preferences.xml and substitute your old MachineID and ProcessedMachineID

  4. Start Plex

  5. Complete the final step in the ‘Move install to another system’

    Final Maintenance
    You can do some final maintenance to clean things up and ensure your server is running as quickly as possible. Perform the following library actions, in this order (and wait for them to complete before proceeding to the next):
    If you originally disabled the Empty trash automatically after every scan setting, you can turn that back on
    Empty Trash for the server
    Clean Bundles for the server (wait at least a couple of minutes even after the dialog box goes away before proceeding)
    Optimize the server

  6. Go to Settings - Server - General and Settings - Server - Remote Access to verify those are working as well.

I thank you Sir, for taking the time to generate such a comprehensive guide. Transferring files as we speak, which will take a while. I will post back on how it all went.

Thanks again. :slight_smile:

While you are doing that, I’m continuing to work on my ability to support better.

The ‘guide’ is based on a lot of information collected with many years of ‘experience, glue & twine’ holding it all together. It’s not been tried yet. I will confirm and formalize it if/when I have the ability here.

Anything you can provide in the form of corrections, points-of-order, and other suggestions is greatly appreciated and will go into the full writeup

Edit:
I failed to mention:

After completing migration, Remove all the old media locations from your Library sections. Only the Synology location matters from this point forward

In the end, it ended up not being too difficult to do. Just time consuming. Or maybe I was so worried about it, it just seemed less of an issue. :slight_smile:

This is what I did:
1 - Install PMS on the Synology using the PlexPass package.
2 - Start PMS and do the basic configuration, but without adding any folders to any library. Make sure to disable empty trash and automatic library updates while doing this.
3 - Stop PMS on Synology
4 - Stop PMS on Mac
5 - Transfer files from Mac to Synology (this takes a long time)
6 - Create tarball from all files under ~/Library/Application Support/Plex Media Server/, but excluding the “Plug-ins” directory
7 - Convert ~/Library/Preferences/com.plexapp.plexmediaserver.plist to readable format by executing plutil -convert xml1 com.plexapp.plexmediaserver.plist
8 - Open com.plexapp.plexmediaserver.plist and look for “MachineIdentifier” and “ProcessedMachineIdentifier” entries and copy value to temporary document.
9 - Transfer tarball from Mac to Synology
10 - Extract tarball into Plex directory on Synology. Path is dependent on where Plex was installed, in my case /volume1

Added 5/29:
10a - Execute chown -R plex:users . from inside the Plex directory

11 - Open Preferences.xml under [PATH_TO]/Plex/Library/Application Support/Plex Media Server/ and look for “MachineIdentifier” and “ProcessedMachineIdentifier” and change values to the values previously copied from Mac into temporary document.
12 - Start Plex on Synology
13 - Open Plex in web browser. All content from your old library should be there
14 - Add new location to each library section. Do not remove anything yet.
15 - Update library sections manually. This will take a while.
16 - When fnished, check if all looks ok
17 - Go back to library sections and remove all old obsolete entries leftover from old machine
18 - Update library sections again.
19 - Turn on empty trash and automatic updates (if desired)
20 - Enjoy Plex on Synology as if it always had been running there.

2 Likes

Watched status is all good? Playlists good? Shares with other users good?

Watched status is all good. Not using playlists. Shares are good.

I have a few movies (6 in total) that seemed have been put in the wrong order of being added to the library (ie bumped to the front as latest), but that is probably caused by me not setting up the agents properly in the beginning as these also have to have some issues with matching - despite them being in the library already, Plex still goes online using the agents to retrieve some data. I can imagine if something goes wrong here and internet results and library results dont line up, things can get strange.

But this is so minor, I can live with that.

outstanding. I’m go over your procedure and see what can be included in the use-cases for mac - other linux.

It’s important for anyone reading this thread to remember to turn off the automatic updating and empty trash options on the system migrating from before making the database copy so Plex is already has the options set when started on the new system after migrating but before you can get in to fix the new library locations.

Looking back, I missed a step:
10a - Execute “chown -R plex:users .” from inside the Plex directory

Not setting the permission correct will give you a whole other set of headaches

Hi everyone,

This was extremely helpful and I was able to migrate from Mac to a Synology RS3617xs+ successfully. I did find that overwriting the library folder and not deleting/replacing is problematic. When I first copied the Library folder I just had it overwrite the files. None of the cover art and meta data for TV Shows would show up. I then deleted it and started the migration over. This time I deleted the Library folder and replaced it with the one from the Mac. While initially the metadata and cover art for TV Shows didn’t show up, refreshing metadata solved it this time. Thank you!

Mike

Great!! It answer my third question before even asking it! :smiley: I will move from my Mac mini with a Pegasus R4 RAID to a DiskStation DS918+.

Thanks!

I only want to say thanks guys, I just got to configure my nas synolgy with plex from mac.

Thanks, good job.

Also wanted to add my thanks here! My Plex server is now running off my DS918+.