Unable to copy server to new computer

Server Version#: 1.19.3.2740
Player Version#: N/A

I am trying to copy my plex server metadata from an old debian machine to my new Ubuntu 20.04 machine. Here are the steps I took:

  1. Mounted media drive to the same path so that paths will match up in plex
  2. Copied /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/ directory from old server to new.
  3. Installed deb package with dpkg -i
  4. Checked service was running sudo service plexmediaserver status and everything looked fine.
  5. Opened web browser to localhost:32400
  6. Said no libraries

Seems like the main two directories with content are Media and Metadata, the rest look similar to the new install. Any suggestions?

back up a few steps.

You want to make a tar ball of the existing to clone to the new one.
Then, after cloning, decommission the original.

Copying usually makes a mess of ownership and permissions.
tar + chown -R after fixes all that. **Remember the new plex UID/GID will be different.

I guess copy is less specific than necessary here, didn’t realize it could be an ownership/perm issue :sweat_smile:

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”

let’s do it again.

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

1 Like

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!

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