Migration Questions

Hi all,

I presently have a PMS on a Linux Server that I want to move to another Linux Server. I want to maintain the users watched history and the date added dates for the Movies.

While I know how to transfer the watched history the date added is not so easy, so I was wondering if just copying the PMS directory from one to the other is a valid option.

This is the directory I’m talking about:

Thoughts/comments would be greatly appreciated.

EDIT: The Library locations will be different on the new Server but the content will be the same.

TIA

Very simple operation.

Source machine:

  1. Turn off all automatic Library settings (don’t forget to SAVE)
  2. Stop Plex
  3. Make the image
sudo bash
cd /var/lib/plexmediaserver
tar cf /path/to/safe/place/PlexBackup.tar  ./Library

Transport that to the new machine.
The reverse of that will be the base steps:

  1. Install Plex
  2. Stop Plex
  3. cd /var/lib/plexmediaserver
  4. sudo rm -rf Library
  5. sudo tar xf /path/to/PlexBackup.tar
  6. sudo tar chown -R plex:plex ./Library

Now follow the steps I skipped here (near the end) about adding the new locations BEFORE YOU DELETE the old locations. This is how we keep the metadata and other history.

1 Like

Thank you once again @ChuckPa . I will take a read before proceeding, but when you say to turn OFF the automatic Library Settings you mean Settings | Library. Correct?

EDIT: After reading the doc you linked I’m now clear where the Automatic Setting are, thank you.

At the end to the doc it says:
Empty Trash
Clean the bundles
Optimise the database

Can you tell me where I find these functions? Thanks once more.

Hover over the server’s name (Left Pane).
Expose the “+” and “…” (ellipsis).

Under the Ellipsis, you’ll find these actions (they are server global)

1 Like

Too easy, thank you.

Followed the instructions, but get the message that the PMS Server is unavailable.

Could this have something to do with the source and target where on different ports?

Different ports? You should be opening port 32400 or is this a remote server?

Get to the shell.

Make sure the processes are up and running.

You might need to reclaim it by opening, incognito, by the LAN IP (same subnet).
(you shouldn’t use app.plex.tv for this step)

Yes, it’s a remote server. Makes a difference??

Yes.

SSH tunnel to it.

ssh -L 8888:127.0.0.1:32400   ip.addr.of.server

Now log into that remote shell and let the session sit idle.

Locally,

  1. Open incognito window
  2. Open http://127.0.0.1:8888/web

The trafffic will route local port 8888 → remote port 32400 and add the /web endpoint .

It will be as if local to the console.

When confirmed claimed and running, you can close the ssh session.

The installation on the remote hosted PMS requires you to claim it before installation will proceed.

Do I change this command:

ssh -L 8888:127.0.0.1:32400 ip.addr.of.server

from 32400 to the actual PMS port number (14175)?

It is not possible to claim before installing because claiming is an active communication between PMS and Plex.tv.

No you do not use the external port (14175). You are ‘inside’ the host. When inside the host, always use 32400.

Please provide more info. I’m not understanding the operating environment.

Is this some kind of Docker container?

Yes it is.

This is going to be a pain.

You said you were migrating PMS and I assumed a native install → native install.

When you add migrating a docker container, it all goes sideways EASILY.

What’s the host platform? Is it Proxmox or OMV ?

Neither, it’s a Seedbox. Problem made worse as source is not Docker and target is Docker.

I can transfer the watched status for the various users but it’s the Date Added that is all screwed up. Maybe I just have to live with it.

Ok. That’s going to be a gamble.

Best advice I can give you is as follows.

  1. Keep that tar file (the cloned backup of the source machine. You’ll still need it.
    – You will need to scp that file up to the seedbox.

  2. Create the docker except:
    a. Do not add the PLEX_CLAIM token string into the config
    b. Set the PUID,PGID,PLEX_UID, PLEX_GID to match the UID/GID of the host PMS is coming from
    c. Let it run for a moment then stop it.

  3. Get into the Seedbox’s native filesystem.

  4. You want to be wherever /config is mapped to.

  5. In the filesystem, where /config is mapped, you’ll see Library. This is our target

  6. The goal is to take your ./Library tar ball and REPLACE its Library directory without docker knowing, with the one you’re bringing over.
    a. From the shell, in the host OS, cd /wherever/config/is
    b. mv Library Library.junk
    c. tar xf /path/to/original/host/PlexBackup.tar

  7. What the above should do for you, which you need confirm, is create a perfect Library/Application Support/Plex Media Server structure with all the subdirectories included.

  8. Before advancing further, ls -la to see if the UID/GID of Library and Library.junk match.

  9. Perform a chown -R UID.GID ./Library if appropriate to make the transplanted data match the container internal environment.

  10. Once done, Spin it up

Thanks @ChuckPa for all your time. I will give it a go.

Make sure you understand what we’re trying to do at each step.

By understanding my intent, you can adapt on the the fly if things aren’t entirely as I wrote out.

Do ask if you encounter any issues

Will do, thank you.

I’m making progress, however seems I cannot have both servers (old & new) show up on the PMS home page.

http://<IP_OF_PMS>:32400/identity of both servers show the same ID:

MediaContainer size=“0” claimed=“1” machineIdentifier=“same-ID-is-Here” version=“1.25.9.5721-965587f64”> </MediaContainer

This might be an issue?

That’s correct. Plex.tv tracks servers by their ID. You cloned one to take to the other.
At this point, they are mutually exclusive.

To remedy this we will change the host-native server. (don’t mess with Docker)

  1. Stop Plex

  2. Go to /var/lib/plexmediaserver/Library/Application Support/Plex Media Server

  3. As ‘root’, using the text editor of your choice, edit Preferences.xml.

  4. VERY CAREFULLY, remove the following Name="Value" pairs (the entire pair=value)

  • MachineIdentifier
  • ProcessedMachineIdentifier
  • AnonymousMachineIdentifier
  1. SAVE the file

  2. Start PMS

  3. Open the server by LAN IP and make certain it claims again.

We are going to void the certificate for this server and issue it a new one as soon as you have it running and claimed. (I need to be able to distinguish which is which at Plex.tv)

If you have other plans here - Please do let me know in advance if possible.

I didn’t know you were going to run both simultaneously.