I guess copy is less specific than necessary here, didn’t realize it could be an ownership/perm issue
I used borg backup which is supposed to preserve all of the permissions and ownership for files. I used this to backup the entire drive of the old machine (including /var). I then removed the new (default) Plex Media Server directory. Then I mounted the backup drive on the new machine and did sudo cp -r /mnt/backupdrive/var/lib/plexmediaserver/Library/Application Support/Plex Media Server /var/lib/plexmediaserver/Library/Application Support/.
So at this point, do I need to use chown -R to make the plex user the owner of the entire directory? I’m not super well versed in linux users/groups/perms so I apologize if this is a dumb question.
Just tried extracting the Library directory, moving to new server, chown -R plex:plex ./Library in the correct dir, and then finally sudo service plexmediaserver start. It starts up fine but all libraries say “There was an unexpected error loading this library”
In the how-to, i tell you to turn all the automatic Library actions OFF.
You’ll lose metadata and watch history if you didn’t do that.
Also, if media isn’t mounted in the same place, you’ll need remedy all that AFTER turning the automatic updating in Settings - Server - Library OFF
sudo sh
systemctl stop plexmediaserver
cd /var/lib/plexmediaserver
mv Library Library.unused
mkdir old-system
# mount the old `plexmediaserver` directory here
mount blah-blah/plexmediaserver ./old-system
# Now use tar to make it all fresh ( I presume you have enough space for this)
cd ./old-system
tar cf - . | (cd /var/lib/plexmediaserver ; tar xf -)
# Let that run, undisturbed, until it completes
# Now apt the ownership of the old system to this system
chown -R plex:plex ./tmp_transcoding ./Library
I assume you know how to remove the old server from Authorized Devices before starting on this host?
( Remember, the hostname is the Friendly Name unless you’ve specified otherise. It’ll be confusing keeping the old and new apart until the old instance is removed… It will be recreated when PMS starts )
systemctl start plexmediaserver
Now access it via 127.0.0.1:32400/web or the LAN IP:32400/web (same subnet)
Sign in and start adjusting media paths
If the media paths are different, you’ll need do this step now.
After all is done, you can go back and remove the Library.unused tree with sudo rm -rf /var/lib/plexmediaserver/Library.unused
Thank you so much, that worked!! I think the issue was related to the tar step, some perms must have gotten messed up the way that I did it.
Here’s a full log of the commands that I used incase this is helpful for anyone else using borg backup:
$ sudo service plexmediaserver stop
$ cd ~/Desktop
$ mkdir borgextract && cd borgextract
$ borg extract /media/....../backup var/lib/plexmediaserver
$ mv var/lib/plexmediaserver/Library ./Library
$ ls
Library var
$ cd /var/lib/plexmediaserver
$ sudo mv Library Library.unused
$ ls
Library.unused
$ sudo mkdir old-system
$ cd old-system
$ sudo mv ~/Desktop/borgextract/Library ./
$ tar cf - . | (cd /var/lib/plexmediaserver ; tar xf -)
$ cd ..
$ pwd
/var/lib/plexmediaserver
$ chown -R plex:plex ./tmp_transcoding ./Library
chown: cannot access './tmp_transcoding': No such file or directory
Opened plex in browser, greeted with how plex works new server setup. All 3 libraries show up (Movies, TV Shows, Music). Click through to “done.” Everything looks perfect!