My Plex server crashed so here is how I migrated the information over.

First Steps

Server Information

  • Old Server
    • User: plex
    • Media Content
      • /PLEX
    • Database/Metadata
      • /var/lib/plexmediaserver/Library/Application Support
  • New Server
    • User: PlexServer
    • Media Content
      • /media/root/8e0e4980-0e2a-4183-d10b2b9c4329/Data
    • Database/Metadata
      • /var/lib/plexmediaserver/Library/Application Support

Steps

  • Connect the non booting hard drive to the new server and copy the media content
  • I created symbolic link to “trick” the system in thinking the data is stored in /PLEX
ln -d -s /media/root/8e0e4980-0e2a-4183-d10b2b9c4329/Data PLEX
  • Next stop the service
systemctl stop plexmediaserver
  • Rename the old /var/lib/plexmediaserver/Library/Application Support/Plex Media Server to OLDPlex Media Server
  • Copy the Plex Media Server folder to /var/lib/plexmediaserver/Library/Application Support
  • Now since the user is different I need to change the permissions
chown -R PlexServer:PlexServer '/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/'
setfacl -R -m u:PlexServer:rx /media/root
  • We also need to edit the plexmediaserver.service file (kinda)
systemctl edit plexmediaserver
  • Enter this information with the correct info
[Service]
User=PlexServer
Group=PlexServer
  • Now start the server
systemctl start plexmediaserver
  • If you get any errors check out /var/log/syslog
  • Browse to the server IP to register your server to Plex
http://IPADDRESS:8888/web

Reference:

https://support.plex.tv/articles/201370363-move-an-install-to-another-system/
https://support.plex.tv/articles/202915258-where-is-the-plex-media-server-data-directory-located/
https://ss64.com/bash/ln.html
https://askubuntu.com/questions/676007/how-do-i-make-my-systemd-service-run-via-specific-user-and-start-on-boot