**Description** <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> ⚒️ Fixes # <!--(issue)--> front matter is supported by all doc sites (including github markdown rendering and is easier to add extra metadata later on, if we want to. ``` --- title: sometitle --- ``` **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> **📃 Notes:** <!-- Please enter any other relevant information here --> **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._
7.7 KiB
title
| title |
|---|
| Community Migration Guide |
:::caution
This guide does not fall under support, use at your own risk. You can create a thread in our discord channel #📚・tc-scale-apps for basic support for the guide itself.
:::
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 scancheckbox 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:
heavyscript --mount
1
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:
zfs set mountpoint=legacy "apps/ix-applications/releases/plex/volumes/pvc-97b6d951-7dac-45fa-81fa-76cb5707fb86" && rmdir /mnt/mounted_pvc/plex-config
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.
cd /mnt/mounted_pvc/plex-config
Run this command to verify you see a single dir called Library.
ls
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.
rsync -rav Library /mnt/POOL/DATASET
Check the dir if it contains a dir called Library if it does then unmount the PVC.
heavyscript --mount
2
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.
:::danger
Be very cautious while in this particular dataset. Run the commands carefully.
:::
To quickly get the correct directory run the following commands:
cd /mnt/POOL/ix-applications
find /mnt/POOL/ix-applications -name Preferences.xml
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.
rsync -rav /mnt/POOL/ix-applications/releases/plex/volumes/ix_volumes/ix-plex_config/Library /mnt/POOL/DATASET
Verify if the the temp dataset contains the Library dir by running this command.
ls /mnt/POOL/DATASET
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.
heavyscript --mount
1
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:
zfs set mountpoint=legacy "apps/ix-applications/releases/plex/volumes/pvc-97b6d951-7dac-45fa-81fa-76cb5707fb86" && rmdir /mnt/mounted_pvc/plex-config
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:
cd /mnt/mounted_pvc/plex-config
Check if you're in the right location by running:
ls
You should only see a single dir called Library.
Delete this dir from the new app.
rm -r Library
Change the working directory to the temp dataset.
cd /mnt/POOL/DATASET
Run the ls command on the dir to verify that its correct and you see a single dir called Library.
ls
If everything is set you can proceed to run the rsync copy command to the mounted PVC location.
rsync -rav Library /mnt/mounted_pvc/plex-config
:::note
This process can a while to complete depending on how large your config is and how your pools are setup. Make sure scale doesn't time out, simply keep the tab active and interact with the page menu top right will suffice until its done.
:::
If the operation completed successfully you can run the following commands to unmount the PVC.
heavyscript --mount
2
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.




