There’s a support article with some general hints regarding this: https://support.plex.tv/articles/201370363-move-an-install-to-another-system/
Step 1
Please go ahead and follow the steps under “Preparation”.
Step 2
Now, according to this, your Plex data directory should be located at
/mnt/HD/HD_a2/plex_conf/Plex Media Server/
You can verify this path by going into your PMS settings and checking it against the path under > Scheduled Tasks > Backup directory (without /Plug-in Support/Databases). Please note that if your path differs from the one above, you will have to replace the above path with your path for every single step.
Step 3
Your NAS probably will not let you access this folder from the WebGUI or any network share, so you will have to this via the console (ssh). You can find a guide on how to set up SSH or your NAS here.
Once this is done and Plex is installed on your NAS, you need to log in via ssh using the Mac terminal. Enter the following command into the terminal:
ssh [username]@[nas_ip_address]
This will ask you for the password you just configured.
Step 4
Once you are logged in (you can tell because the text before the colon should change to [nas_username]@[nas_hostname]), you should now verify your install path again:
stat /mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/
This should result in an output like this:
File: /mnt/HD/HD_a2/plex_conf/Plex Media Server/
Size: 4096 Blocks: 8 IO Block: 4096 directory
[...]
Access: (0755/drwxr-xr-x) Uid: ( 1000/ [username]) Gid: ( 1000/ [group-name])
If this worked, write down the username and group-name from the above output (they might be identical). Log out of the NAS by typing
exit
and hitting Enter. You should now see your mac username and hostname before the colon again.
Step 5
Now we need to copy the Plex folder over to the NAS. We are going to use rsync for this.
If your Mac’s Plex folder is in the default location, you can copy the files like this:
rsync -rLptgoDvzPm --dry-run --exclude=.DS_Store ~/Library/Application\ Support/Plex\ Media\ Server/ [username]@[nas_ip_address]:/mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/
This command will perform a test run for copying all contents from your current Plex folder to the NAS’s Plex folder. Before running it will ask you for SSH password you configured for your NAS.
Quick explanation:
-a or -rlptgoD: “archive” and sync recursively and preserve symbolic links, special and device files, modification times, group, owner, and permissions (note: we are using -L instead of -l since we do not want copy symbolic links to files on the old system but rather copy those linked files themselves)
-v: show what’s going on
-z: compress data during transfer
-P: show file transfer progress
–dry-run: perform a trial run with no changes made
–exclude=.DS_Store: this will stop rsync from transferring macOS’s hidden attribute files
This should output a bunch of filepaths and something like this at the end:
sent 5,783 bytes received 519 bytes 4,201.33 bytes/sec
total size is 9,433,361,773 speedup is 1,496,883.81 (DRY RUN)
If this worked fine (and only then) you can run the command again without the --dry-run flag. The transfer will take a while since your library is quite large.
Step 6
Once the transfer is done, log into your NAS using ssh (see above) and make sure all the files in the folder are owned by the correct user and group you wrote down earlier:
chown -R [username]:[group-name] /mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/
Step 7
Continue following the steps in the guide (start at the Reboot the Destination System-section). After that, it should all be done!
Disclaimer (sort of)
I have neither a Mac nor a WD NAS around to test this. I have no way of knowing whether these commands will match your setups. So you are running all of them at your own risk. I’ll gladly try to answer any questions you have, but I will not take responsibility if anything goes wrong.
Edit [2018-10-15]: Updated this post with learning from posts below for future reference.