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.
Turn off all automatic Library settings (don’t forget to SAVE)
Stop Plex
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:
Install Plex
Stop Plex
cd /var/lib/plexmediaserver
sudo rm -rf Library
sudo tar xf /path/to/PlexBackup.tar
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.
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.
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.
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.
Get into the Seedbox’s native filesystem.
You want to be wherever /config is mapped to.
In the filesystem, where /config is mapped, you’ll see Library. This is our target
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
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.
Before advancing further, ls -la to see if the UID/GID of Library and Library.junk match.
Perform a chown -R UID.GID ./Library if appropriate to make the transplanted data match the container internal environment.
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)
Stop Plex
Go to /var/lib/plexmediaserver/Library/Application Support/Plex Media Server
As ‘root’, using the text editor of your choice, edit Preferences.xml.
VERY CAREFULLY, remove the following Name="Value" pairs (the entire pair=value)
MachineIdentifier
ProcessedMachineIdentifier
AnonymousMachineIdentifier
SAVE the file
Start PMS
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.