Community Migration Guide
This guide will walk you through on migrating your plex config data from an old to a new plex instance.
The first thing you need to do is go to settings and then Library.
- Disable
Empty trash automatically after every scan
checkbox if its enabled.
Go to Settings -> General and Sign Out
of your server completely.
In TrueNAS Scale, go to Apps -> Installed Applications and stop the old app.
Follow the sub section depending on how your app config was stored.
- App config on PVC -> Backing up App Data From PVC
- App config on HostPath -> Accessing App Data From HostPath
- App config on HostPath(ix-applications) -> Migrating App Data From IxVolumes
Dataset Permissions
This is our default perms for our plex app. Please make sure to keep plex perms set to 568
.
Migrating Data from PVC
To access the old app’s data from PVC, we are going to use heavyscript mount
flag.
Go to System Settings -> Shell.
Make sure heavyscript is installed and active (refer to the link above for the how to guide) before running the following commands:
You will get list similar like this for example.
To mount the directory just enter the correct number…so for me I have to enter 24
. Verify the number you are entering is for plex-config.
You will get another list similar like this for example.
To mount the directory to your root pool just enter the correct number…so for me I have to enter 3
. Verify the number you are entering is for root.
you will get a unmount command similar to this:
The old plex app is mounted in a dir for example /mnt/mounted_pvc/plex-config
.
The above assumes your app is named plex
, if its not the dir name
will be different.
Run this command to verify you see a single dir called Library.
Create a temp dataset in storage -> datasets for your old app plex config with the follow perms.
Replace this command’s path with your OWN pool
and dataset
name.
Check the dir if it contains a dir called Library
if it does then unmount the PVC.
You can delete the original app at this point.
Please move on to Migrating App Data to the New App.
Migrating Data from HostPath
If your plex config is available on your own dataset, validate its perms.
Follow the prerequisites and then uninstall the original app. If the perms are good you can move on to migrating to the new app.
Migrating Data from ixVolumes
This section is only for the official app where users didn’t specify their own hostpath.
To quickly get the correct directory run the following commands:
You should see an output like so -> /mnt/POOL/ix-applications/releases/plex/volumes/ix_volumes/ix-plex_config/Library/Application Support/Plex Media Server/Preferences.xml
We are only interested for this location as its the start of the config dir for plex -> /mnt/POOL/ix-applications/releases/plex/volumes/ix_volumes/ix-plex_config/Library
.
Create a temp dataset in Storage -> Datasets for your old app plex config with the follow perms.
Go back to the system shell and replace this command’s path with your OWN path
, pool
and dataset
name.
Verify if the the temp dataset contains the Library
dir by running this command.
If it does please move on to migrate to the new app.
Migrating App Data to the New App
If the new plex app is not installed yet, please do so now. Verify that the new app can go active with just the defaults for now.
If it works, don’t sign in yet, simply turn off the app and then go to System Settings -> Shell.
We’re going to mount the new plex app config data. Run the following commands in the shell.
You will get list similar like this for example.
To mount the directory just enter the correct number…so for me I have to enter 24
. Verify the number you are entering is for plex-config.
You will get a unmount command similar to this:
The new plex app is mounted in a dir for example /mnt/mounted_pvc/plex-config
.
Change the working directory to the mounted dir for the new app:
Check if you’re in the right location by running:
You should only see a single dir called Library
.
Delete this dir from the new app.
Change the working directory to the temp dataset.
Run the ls
command on the dir to verify that its correct and you see a single dir called Library
.
If everything is set you can proceed to run the rsync copy command to the mounted PVC location.
If the operation completed successfully you can run the following commands to unmount the PVC.
New Plex App
Before you start the new plex app edit the app and add your media via additional storage with the correct mountpath from the original app and update any variables as needed.
The official app from scale use the /data
path for media, but you could have used an entirely different dir for it.
I highly recommend setting up the variable Plex Claim Token
last as it has a 4 min window.
To get a claim token from plex, go to Plex Claim Token.
Once set, save and wait a min for the task to finish and then start the app.
The app will take some time to migrate the db after startup and rest assured its normal to see something like this:
You should now be able to access plex’s web service as normal with all your data intact, sign in if needed.
You can remove the temp dataset that holds your plex config as its not needed anymore.