Copy PMS metadata from Mac to PR4100 NAS

Server Version#: 1.13.8.5395
Player Version#:

I am upgrading my Plex setup from my computer to a dedicated NAS (WD PR4100). I have already transferred the media but haven’t yet installed Plex. I don’t want to rebuild the library of ca. 1800 films since I have a very specific system which would be extremely time consuming to repeat (mostly international old films where I keep original names and posters, etc.).

Therefore I need to copy my existing library (actually just the metadata) from my Mac. I have compressed the Plex library on my Mac and am now trying to find a way to add it to the NAS. I was not able to find a simple explanation how to proceed. Preferably step by step instructions how to access the NAS folders. I have no knowledge of Linux or networking. I would appreciate any help.

1 Like

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.

Thank you for this exhaustive guide. I have just started to follow the steps but have encountered a problem at the very beginning. After assigning a password to NAS (I assume it was accepted since I had no confirmation) I tried to log in but got the following response:

The authenticity of host ‘10.36.62.243 (10.36.62.243)’ can’t be established.
RSA key fingerprint is SHA256:tl4zTqt1PHdIqBft9ypxOncV5pp3xNhrzUhWSoafU7Q.
Are you sure you want to continue connecting (yes/no)?

I typed yes, and got the following:

Warning: Permanently added ‘10.36.62.243’ (RSA) to the list of known hosts.
Connection closed by 10.36.62.243 port 22

Now I’m stuck. I hope I didn’t mess things up.

Ah, yes. I forgot to mention that. It only asks that once, however.

Two questions/remarks:

  1. Which username did you use? The guide I linked to mentioned sshd.
  2. In case you did use the above username, try this.

Let me know if this get’s you logged in.

Yes of course I didn’t notice that. I got in:

BusyBox v1.20.2 (2014-10-30 15:29:55 CST) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

root@BPMyCloud root # stat /mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/
File: /mnt/HD/HD_a2/plex_conf/Plex Media Server/
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 901h/2305d Inode: 120455487 Links: 11
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2018-10-08 17:42:58.000000000
Modify: 2018-10-12 10:51:54.000000000
Change: 2018-10-12 10:51:54.000000000

I deleted the files on the NAS, logged out and tried the rsync dry run but got the following errors:

rsync: --dryrun: unknown option
rsync error: syntax or usage error (code 1) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52.200.1/rsync/main.c(1337) [client=2.6.9]

My bad (again) :grinning:

It needs to be --dry-run (dash was missing). I have corrected this in the post above.

OK I did the dry run and got a very long listing with the following at the end:

sent 17855394 bytes received 1904060 bytes 774880.55 bytes/sec
total size is 8854664630 speedup is 448.12

It did not say ‘dry run’ though at the end (as you wrote).

Alright. This might be OS/version specific. You can make sure you did not (yet) transfer anything by logging in to your NAS via ssh (run ssh sshd@[nas_id_address]) and listing the Plex folders’ contents like this:

ls -l /mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/

It should output nothing but total 0. If that’s what see, log out by typing exit and run the rsync-command without --dry-run.
Tip: Instead of typing the entire command again you can use the arrow-up key to get the previous command. So, hit arrow-up until you see the rsync [...]-command again, remove --dry-run and run the command.

OK I got only this:
root@BPMyCloud root # ls -l /mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/

In case your “got only” that by pressing arrow up, you forgot to log out of the NAS.

If that’s what see, log out by typing exit and run the rsync-command without --dry-run .

If that’s not what you meant, please clarify how you got to that.

Sorry for not being clear. I logged into NAS and listed the Plex folder contents. It did not say ‘total 0’ but the line: root@BPMyCloud root # ls -l /mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/

Did you actually run that command? That looks just like the command entered into the console rather than it’s output.

If that’s the output of running the command I’d assume that the folder is empty and that you can go ahead and run rsync.

Yes tried it again but keep getting the same command replicated… :

BusyBox v1.20.2 (2014-10-30 15:29:55 CST) built-in shell (ash)

Enter ‘help’ for a list of built-in commands.

root@BPMyCloud root # ls -l /mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/
root@BPMyCloud root # ls -l /mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/
root@BPMyCloud root #

Ok. That should mean the folder is empty. Go ahead and log out of the NAS and run rsync.

Everything seems to have copied but now I’m stuck at the chown command. What is my user name?

Check my original post. If you run stat on the Plex folder, there is a username and group name under Access. Use those for the chown command.

I realize that but it doesn’t seem to work ; am I entering the wrong syntax?

I have the following: Uid: ( 0/ root) Gid: ( 0/ root)

In that case running

chown -R root:root /mnt/HD/HD_a2/plex_conf/Plex\ Media\ Server/

should to the trick.

Doesn’t work either:

chown: root: illegal group name