How to replace PlexOnlineToken without losing PMS settings and stats?

Server Version#: 1.43.0.10467

I made a mistake and the PlexOnlineToken from Preferences.xml on my local PMS is possibly compromised. I don’t have a reason to think it’s been used or seen by anyone (yet) but I want to reset it asap.

The way I understand it - this is the master token that associates PMS with app.plex.tv account. I know where to remove my home server from authentications (https://app.plex.tv/desktop/#!/settings/devices/pms) but I’m trying to figure out how to minimize or avoid data loss, specifically: my home profiles, watch history, libraries, settings and similar. I know I can disassociate the home server from plex.tv and re-claim using the claim token but I don’t know if that’s the best way to prevent or minimize data loss.

Any insight would be appreciated!

Using the Plex web app, you go to
Settings - [server name] - General
and use the “Remove” button.
This will invalidate the server token.
Then stop and restart the server.

Now continue to claim the server as if it was a new installation.
On Linux, you probably want to use GitHub - ChuckPa/UserCredentialReset: User Credential Reset utility for Plex to do this.

Do NOT mess with the Preferences.xml.
Do NOT delete/rename/modify anything in the Plex data folder.


If you have already removed the server on this page: https://app.plex.tv/desktop/#!/settings/devices/pms
you do need to edit the Preferences.xml though.
Do it exactly as described here: https://support.plex.tv/articles/204281528-why-am-i-locked-out-of-server-settings-and-how-do-i-get-in/
i.e. stop the server first,
then edit the Preferences.xml
then start the server again.
Then claim it like a new server installation. You can use the claiming script as linked above.

Thank you @OttoKerner . It worked perfectly. The script couldn’t find my Preferences for some reason (I’m running the official image in Kubernetes) but at least it had a fallback and I could provide the path. All came back as if it never happened!

Edit:
Actually there was one more part to this. Just removing the PMS server was not enough, it came back with the same PlexOnlineToken . I had to also go to Settings → Authorized Devices and remove it from there as well. Then I was able to receive a fresh Token.

You must run INSIDE the container or use the -p /path/Prefences.xml from outside.

Yup, I did. I ended up providing the path and it worked.