Server Database Backup Issues on Raspberry Pi

I have been running a Plex server for music on a Raspberry Pi 3B+ for a few years and will be moving it over to a new Raspberry Pi 4B in a NAS case kit.

I went through the steps of stopping Plex with sudo systemctl stop plexmediaserver.service and grabbing the directories out of the /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/ directory.
But I am having an issue with access/permissions. Some of the files in the Metadata folder are giving me an error that I do not have permission to access them, and so then they do not get copied along with the rest of the folders.
Source Metadata folder contained 64,036 files, 73,219 folders and the destination after copying over only had 63,853 files, 73,210 folders, leaving a difference of 183 files that did not get copied/backed up.

  • Any tips on how to clear up that error to sort out my permissions? Please keep in mind I am very novice with Raspberry Pi and Linux in general and was not able to fix it through folder properties through the GUI desktop.

  • If I attempt to use the files I have successfully copied over (minus the 183), would there simply just be gaps in my metadata that needs to be scraped again? (Album art, tracks, artist profile, perhaps?) Or would the missing pieces make the entire backup unusable by the new server?

  • Additionally, the main thing I am concerned about preserving is my play history and statistics (network usage, time music listened, album count, etc). Which folder contains this data? Would I be able to move this data to a new server without the complete Metadata folder?

Thanks for any help or guidance you can provide. If there is more info I can provide, I will do so gladly.

You MUST remember to match the UID/GID of the files on the new system to that system.

e.g.

  1. If you run as plex:plex on the original
  2. sudo chown -R plex:plex /var/lib/plexmediaserver on the new (assuming both use plex:plex.

UID/GID is always subject to change when you switch hosts. (things can happen during copying)

Thanks for the tip, I will have to keep that in mind.
But I’m not even at that point yet, I am sill trying to simply copy the database folders off of my original Pi (I get the same errors whether copying to a drive on my Windows PC over the network, or even just copying from my Pi’s SD card to a USB HDD attached directly to it).

And are you able to provide any insight into my 2nd and 3rd questions?

  • What would happen if I used this incomplete backup of the Metadata folder?
  • Which folder should I back up to retain history and statistics?

Thanks very much.

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