Has anyone done this very specific Linux migration?

You may already understand, that attaching the plex data folder alone to new VM isn’t enough, you would also need to install the plex Deb installer, so that any dependents, binaries, and start up scripts are installed, then make the appropriate modifications to point to the attached plex data drive.

Yes, and that’s part of the process laid out in the migration article.

There is absolutely no reason to spin up a new VM and then keep the Plex install directory and it’s accompanying configuration directory on NFS. Keep them in the VM and you won’t have any issues. Copy the original directory over to the new server.

Also to touch on some other points you made:

  1. CentOS is not dead. CentOS Stream will work for 99.9% of all use cases. Don’t even get me started.
  2. Of course Fedora doesn’t take anything from the original product that RedHat makes. It’s the other way around.
  3. NFS is good for sharing out your media, not your Plex install directory and accompanying configuration files.
  4. Docker/podman does all of this and it takes literally one command to install on any CentOS/RHEL/Fedora machine.

Can I be of help here?

It seems as if there’s some confusion / divergence from what the OP is requesting?

@ember1205

Referring back to the OP, I understand the following:
(Please correct me where I’ve misunderstood ?)

  1. You have an existing openSUSE installation of Plex.
  2. You want to spin up a (or more) new “virtual guest” instances (VMware, ESXi, or Docker)
  3. You want each to stand alone (new IP addresses) as discrete servers.
  4. You want to share the media via NFS.
  5. You also want to share the Plex data.

Is this correct ?

@ChuckPa

Close …

  1. Is correct

  2. I have built a new openSUSE guest (virtual machine, zero interest in Docker for this).

From there, it’s a bit different. I want to wholly migrate the server in item 1 to the server in item 2.

My environment already contains two additional servers (besides the one I want to migrate) and those are staying exactly as they currently are.

I attempted to follow the docs here for how to migrate a server and it doesn’t work. At the step where I should be able to access the server post migration, I get a “not authorized” error and am redirected to one of the two other servers.

@Volts and @TeknoJunky have provided some good info about how to approach the drive mounting piece for the app directory. I have been using NFS for years for the content and am all set there as well.

So, the issue I am still trying to solve is how to complete the migration of ONE server in a multi server environment because the process covered in the docs seems to work only for single server environments.

IF you’re using all the default locations:

  1. Migrating “the whole server” (meaning PMS) is as
    a. Make a tarball of /var/lib/plexmediaserver,
    b. Install PMS on the new host (whatever it is)
    c. Stop PMS after installing (it will auto start that first time)
    d. Remove the newly-created Library directory in /var/lib/plexmediaserver
    e. Untar the cloned tar ball to supersede that which was created
    f. sudo chown -R plex:plex /var/lib/plexmediaserver to update to the new UID:GID

  2. Having made a clone, one of the two “Preferences.xml” file must be deleted so the server, when it starts, can create all the new ID values and then be signed into the account

This is what bothers me

There are many things which qualify as ‘multi-server’ environment.

If you are truly talking about a ASMP (Asymetric Multi-Processing) cluster, which as what is frequently found in a HA environment, then PMS will not work that way.

PMS is written for the home user environment – not a commercial/enterprise grade environment.

  1. The database server, SQLite3 is single-kernel context. It will fail (almost immediately corrupt itself) in multi-kernel environments

  2. Sqlite3 cannot be replaced by SQL Server, MongoDB, or any other larger-scale engine.

To roll back, If you mean “One Server Instance”, which exists in a Single Kernel and Namespace context, to another Single Kernel host (aka. SMP) then it’s as easy as I’ve detailed.

I show the full process here:

  1. Backup from the one host
  2. Restore to another
  3. “Decommision” (note at the bottom) the original server.

I have multiple ESXi guest OS / PMS instances for all the testing I do. Each is self contained and atomic from the others all sharing the same source media

He just wants to run PMS in a virtual machine but how he explains it the install files and the configuration is hosted over NFS.

You literally install PMS on the new server then copy your existing configuration directory to the new server. Check for file permissions and you’re done. You can then mount your NFS directory on the new server to access your media. Having more than one server doesn’t matter. The steps are still the same. You can set the IP address to anything you want.

It’s literally that simple. Don’t share your Plex install or configuration files over NFS. It’s pointless and complicates things.

To copy your existing configuration to the new server you can do this from the command line on the new server:

sftp -a -p -r -P SSHPORT username@oldserverIP:/var/lib/plexmediaserver /var/lib/plexmediaserver

sudo chown -R plex:plex /var/lib/plexmediaserver

@kegbeach

Thanks.

PMS, as in /var/lib/plexmediaserver

  • over ANY file-based network connection = EPIC FAIL
  • encapsulated in the block device mount afforded by the VM = SUCCESS

All my VMs have their VMDK mounted over NFS. Everything inside that VMDK is under the control and scope of the VM’s kernel – therefore it works.

As simple as it gets. NFS mounted block device. AKA. poor man’s iSCSI :slight_smile:

1 Like

Not sure how to better describe than this… My account has three servers in it: Server A, Server B, and Server C. I am interested in migrating Server B to a virtual machine. That’s it. Nothing more complicated than that. No HA, no cluster, nothing at all complicated… Just three individual servers. Post migration (by following the docs) leaves things in a state where the new Server B is inaccessible via the web client. Period. “Not authorized to access this server”. Web client remains connected to Server B, but Server B isn’t in the list of servers and my config attempts are redirected to a different server that is still in my account.

As mentioned, previous info pertaining to leveraging the NFS repository for the storage of the VHD’s and mounting those VHD’s to different mount points off of the OS would seemingly “work” while trying to directly NFS-mount the “Library” directory from a remote drive is extremely risky. That was why I was saying that my remaining issue to address is that I can’t access the server post-migration.

@ember1205

thank you… that boils it right down.

This is just as I described – Cloning the machine - in my steps above

  1. Make the backup (tarball) of ./Library from inside /var/lib/plexmediaserver on the physical machine (PMS stopped)
  2. Create the VM

Inside the VM

  1. Mount all your media at the SAME MOUNT POINTS as the physical machine (duplicating)
  2. Install PMS on the VM host
  3. Stop PMS
  4. cd /var/lib/plexmediaserver
  5. sudo rm -rf Library – delete the skeleton PMS the installer created which is unused
  6. sudo tar xf /path/to/physical-machine-pms-backup.tar
  7. sudo chown -R plex:plex .
  8. Start PMS

Back on the physical host:

  1. sudo rm -rf /var/lib/plexmediaserver/Library (decommission the host)

Task done.

1 Like

The process you outlined does not work. The new server is not accessible via the web interface, and that’s following the more granular steps from the article. Any attempt to reach the Plex interface on the newly installed server results in an error (You are not authorized to access this server or something very close to that) and the web controls are redirected to one of the other servers in my account (although the actual web connection remains on the new server). The new server is also not listed in my account anywhere which seems off because it should at least show up and give some type of access / connection error.

  1. manually go into the new server
  2. Restart PMS
  3. Wait 2 minutes
  4. stop Plex
  5. make a tar.gz of the Logs directory
  6. please attach.

Authentication errors occur when:

  1. Server cannot communicate with Plex.tv
  2. Permission problems within the PMS directory structure preventing it from reading its files.
  3. Breaking Preferences.xml (which results in a signed-out server)
1 Like

I took a different and very particular course of action to reach success. As mentioned, I have three different servers in my account, all within my local LAN (but on different IP Subnets). Under typical operating conditions, the servers all show up as “nearby” in my web client. To continue with my examples so far, my intent has been to migrate “Server B” to a virtual machine.

  • On Server B, shut down Plex, upgrade to newest software (just released), start Plex.
  • On remaining two servers, upgrade Plex to current software.
  • On virtual machine, ensure openSUSE has all the latest updates. Create mount points for the various media locations.
  • On Server B, shut down and disable Plex, run YaST and change IP and hostname information to “new” address. Kick of process to back up Library subdirectory.
  • On virtual machine, run YaST and change IP and hostname information to that of original Server B. Shut machine down, take snapshot.
  • Start virtual machine up, allow it to mount media locations from fstab.
  • Install current version of Plex and ensure Plex has started.
  • Shut Plex down. Rename “Library” to “Library.old”.
  • On Server B, move “lib.tgz” file onto media drive in non-media subfolder.
  • On virtual machine, untar “lib.tgz” file from mounted media drive into “/var/lib/plexmediaserver” directory. Check that permissions are correct. Start Plex.
  • Verify that all three servers are accessible and that all scheduled DVR recordings show on Server B instance in Web Client.
  • On virtual machine, shut down Plex. Partition second virtual hard drive, create filesystem. Remove old “Library.old” directory from original install, move Library to Library.old, create new Library folder, mount new drive/partition under Library, rsync contents of Library.old to Library. Check permissions, start Plex. Verify again that everything is working.

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