Library Metadata lost when HD attached to Mac-OS is moved to RaspberryPi4

Hey! I had my 4TB external HD plugged into my MacbookPro. (so, on the side panel in the app, the HD was listed as a library under the MacBook directory). I spent a great deal of time organizing all of the metadata and created collections, etc. It worked great, on my laptop, Chromecast, Firestick, etc.

Now, I’ve recently decided to move my HD from my Macbook and plug it into a RaspberryPi 4. When I open the Plex app and add the HD (now plugged into a Pi) as a library under the Pi directory, none of the metadata or collections I had when it was plugged into the Macbook. It starts re-checking from scratch.

I haven’t changed the files on the HD at all; I’ve just moved the HD from Macbook to Pi. Is there a way to move the organized metadata/collections to the Pi directory’s library, or do I need to start from scratch?

I’ve checked the forums/FAQ but nothing seems to specifically address moving an HD to Raspberry Pi. Can anyone walk me through this or point me to a link that deals with it? Thanks so much.

In the attached screenshot, you’ll see the library is called “Circle of Cinema” – It was under “Macbook (Ryan)” and now I’ve created a library named “Circle of Cinema” under “Pi” and want to add the same HD to it, while retaining the metadata.
Screen Shot 2022-04-28 at 6.57.10 PM

Metadata, etc is stored in the Plex Data Folder, not with the media.

If you still have the Plex Data Folder on the MacBook Pro, you can move it to the Pi.

See Move an Install to Another System.

Thanks! So, I’ve

  1. stopped the auto-erase in PMS
  2. downloaded the folders at
    ~/Library/Application Support/Plex Media Server/
  3. downloaded the .plist file at
    ~/Library/Preferences/

Since the tutorial doesn’t go into raspberry pi specifically, I’m a bit confused about how to transfer these the to Raspberry Pi and overwrite/replace the old metadata.
Plex is already installed on my Raspberry Pi.

Would I do this by locating the PMS files on the pi’s SD card and copying these files there, or is there a way to install them by SSHing into the Pi from Terminal?

Thanks again.

This step-by-step guide should be helpful in making sure you don’t leave anything out as a part of the migration

The Plex Data Folder from the Mac replaces the Plex Data Folder on the Pi.

The Pi will then have the same libraries as what existed on the Mac. Any existing libraries on the Pi will be lost.

The .plist file from the Mac is not needed.

Follow the steps as outlined in the support document. You can skip the Copy Additional Server Settings From the Source System section. It applies only when moving between like systems (Mac to Mac, etc).

You can compress the ~/Library/Application Support/Plex Media Server/ folder on the Mac, then move it to the Pi and uncompress in the desired location. You can move it over the network, using an external drive, etc. Whatever is easiest.

If you want to use terminal, this should be close. It will create a compressed copy of the Plex Data Folder in your home directory, then copy it to the Pi. Adjust the destination on the Pi if needed. Stop Plex Media Server on the Mac before making the copy (so the database files will be closed).

cd ~/Library/Application\ Support/
tar cfz $HOME/plexbackup.tar.gz ./Plex\ Media\ Server/
cd
scp ./plexbackup.tar.gz root@ip.addr.of.pi:/var/lib/plexmediaserver/Library/Application\ Support/ 

To uncompress on the Pi: tar xf plexbackup.tar.gz

Then set permissions on the folder if necessary: chown -R plex:plex "Plex Media Server" (that’s the syntax for Ubuntu, adjust for the Pi if needed). If Plex runs under a different userid, then adjust user & group accordingly.

1 Like

Thanks so much for this help. Just getting around to

Unfortunately, I’ve run into a problem moving the compressed file to the destination folder on the pi.

  1. I see that the old files on the destination are saved in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server.

I tried to put the compressed folder from the mac (which has everything from the Mac’s ~/Library/Application Support/Plex Media Server/ folder) onto a hard-drive and plugged it into the pi. It mounted fine.

Then I tried to copy it into the destination folder on the pi (which is /var/lib/plexmediaserver/Library/Application Support/Plex Media Server), but I got a permission denied error. I also tried to delete what was in the pi destination folder and got the permission denied error. Both errors were permission denied.

So, my question is: how do I provide permissions to move/delete folders from the pi’s GUI?

  1. I also tried it in Terminal.
    When I get to scp I run into problems.

It does work to send ./plexbackup.tar.gz to root@ip.addr.of.pi, but not to any specific folder therein.

I’ve tried your suggestion:
scp ./plexbackup.tar.gz pi@myipaddress:/var/lib/plexmediaserver/Library/Application\ Support/ but it give me the following error “scp: ambiguous target”

I’ve tried a number of combination but I get the same error. For example, I’ve tried every combination I could think of mentioned in this page: macos - scp copy has error "ambiguous target" - Super User

  • moving it to the “Application Support” folder
  • moving it to the “Plex Media Server” folder
  • putting \ before each space
  • putting \ before each space
  • putting the folder names with spaces in quotations
  • putting \ before each space, plus the whole folder name in quotations
  • putting \ before each space, plus the whole folder name in quotations
    -putting after the ipaddress in double quotations (")
    -putting everything after the ipaddress in single quotations (’)
    -putting everything after the ipaddress in double, then singled quotations ("’)

NB: it does work to send ./plexbackup.tar.gz to pi@myaddress but I’d like it to be saved in the pi’s
/var/lib/plexmediaserver/Library/Application Support/Plex Media Server (and have whatever is in that destination folder on the pi deleted and replaced with the new file).

I hope that makes sense. I can clarify or screenshot if it doesn’t.

update:

I just tried scp ./plexbackup.tar.gz pi@myipaddress:/var/lib/plexmediaserver/Library/‘Application\ Support’/‘Plex\ Media\ Server/’ and, for the first time, it didn’t give me the ambiguous target error, but instead said: scp: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server//plexbackup.tar.gz: Permission denied.

So, I think it’s another permissions issue (i.e., same as my #1 question above)

If there is space, try copying the file to /tmp. Any process can read/write to /tmp. Once it is transferred you can then move it to the desired location.

You could move the file via an external HD, USB stick, etc as well. Plug the drive into the Mac, copy the file over, move the drive to the Pi, then copy the file to the desired location and extract.

Depending on folder/file permissions, you may have to be root to move/extract/etc on the Pi.

Once everything is in the desired location, use chown -R to set the correct owner:group.

I was able to unpack the compressed Plex Data Folder and rewrite over the duplicate folders at /var/lib/plexmediaserver/Library/Application Support/Plex Media Server on the Pi. Thanks for all your help in achieving that!

However…
Now I can’t access the Pi on the Plex Web App. It says Pi is currently unavailable.
I’ve followed this to try to locate it on the Web App, but none of the recommendations worked:

On the Plex Web App the Server entry doesn’t appear under Settings.

When I type: http://myipaddress:32400/web/ it doesn’t work.

I’m not using a VPN.

My pi is connected to the network. I can see the 3 hard drives I’ve connected to my pi by entering the command “ls /media/usb1 (…2…3)/” in Terminal. Each of these drives are mounted and otherwise accessible over the network (just not via Plex).

I’ve tried rebooting the pi.

Do I need to re-install Plex on my raspberry pi? (I originally followed this guide How to Setup a Raspberry Pi Plex Server - Pi My Life Up and it worked fine, until I started trying to move over the directory with the metadata from my Macbook onto the Pi, i.e., my original thread).

I worry that if I re-install Plex on my pi via terminal, I will lose the directory/metadata that I just successfully transferred to the pi.

Thanks again in advance!

I also tried the recommendation here: Installation | Plex Support
Which was:
write following command in terminal: "ssh ip.address.of.server -L 8888:localhost:32400
and then open http://localhost:8888/web into a browser.

That didn’t work; it gave me the following error messages:

channel 4: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused

Did you set the owner:group of of the transferred data to plex:plex?

cd /var/lib/plexmediaserver/Library/Application\ Support/
chown -R plex:plex "Plex Media Server"

Is Plex Media Server running?
ps -ef | grep Plex

If so, try using a incognito / private browser window pointed at the Pi’s IP address: http://pi_ip_address:32400/web. If you’re using the Pi itself, go to http://127.0.0.1:32400/web.

If that does not work, then look at Why am I locked out of Server Settings and how do I get in?
You’ll stop Plex.
Edit preferences.ini, removing the specified entries.
Restart Plex.

That will place the server in an unclaimed state. You should then be able to point a browser at http://pi_ip_address:32400/web and claim the server.

It will not overwrite your metadata (and you have a backup, anyway).

That is only needed if you are not on the same network as the Plex server.

The saga continues…

When I run

it ran through all the files, but gave me “Operation not permitted” for each one.

So, I tried sudo chown -R plex:plex ‘Plex Media Server’ and I think that worked. This is what it shows, which looks like everything in the folder is plex:plex for owner:group.

pi@raspberrypi:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server $ ls -la
total 2181260
drwxr-xr-x 14 plex plex 4096 May 17 20:57 .
drwxr-xr-x 3 plex plex 4096 Mar 6 23:57 …
-rwxr-xr-x 1 plex plex 2233541549 May 6 22:14 Archive.zip
drwxr-xr-x 6 plex plex 4096 May 17 13:45 Cache
drwxr-xr-x 5 plex plex 4096 May 17 18:09 Codecs
drwxr-xr-x 10 plex plex 4096 May 17 18:09 ‘Crash Reports’
drwxr-xr-x 2 plex plex 4096 Mar 10 02:04 Diagnostics
drwxr-xr-x 3 plex plex 4096 May 17 20:57 Logs
drwxrwxr-x 4 plex plex 4096 May 6 14:12 __MACOSX
drwxr-xr-x 3 plex plex 4096 May 17 18:09 Media
drwxr-xr-x 8 plex plex 4096 May 17 18:20 Metadata
drwxr-xr-x 17 plex plex 4096 May 17 18:21 Plug-ins
drwxr-xr-x 7 plex plex 4096 Mar 6 23:58 ‘Plug-in Support’
-rw-r–r-- 1 plex plex 793 May 17 22:50 Preferences.xml
drwxr-xr-x 3 plex plex 4096 Dec 29 2020 Thumbnails
drwxr-xr-x 7 plex plex 4096 Apr 24 22:24 Updates

I get the following response:

pi 3095 2178 0 23:18 pts/0 00:00:00 grep --color=auto Plex [Plex is in red here]

Didn’t work. Tried incognito and on a browser through the pi’s GUI.

Tried this, located the file: ‘Preferences.xml’ (you can see it in the folder’s contents above) and edited with Vim, and deleted:

  • PlexOnlineHome="1"
  • PlexOnlineMail="jane@example.com"
  • PlexOnlineToken="RanDoMHexIDecIALtoKeNheRE"
  • PlexOnlineUsername="ExampleUser"
    Then I saved and exited Vim.

Tried http://pi_ip_address:32400/web in incognito and http://127.0.0.1:32400/web on the Pi again, but no luck.

Hmmm…not sure what the problem might be…

I wonder if, after all of this, it would just be better to:

  1. reinstall Plex by running the following
  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install apt-transport-https
  • curl https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --dearmor | sudo tee /usr/share/keyrings/plex-archive-keyring.gpg >/dev/null
  • echo deb [signed-by=/usr/share/keyrings/plex-archive-keyring.gpg] https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
  • sudo apt-get update
    sudo apt install plexmediaserver

and then
2) unpack the files from my Mac with the metadata onto the Pi’s Plex Media Server folder
3) sudo chown -R the pi’s Plex Media Server folder for plex:plex
and
4) try http://pi_ipaddress:32400/web/ and hope it works? what do you think @FordGuy61 ?

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