jagz707 Posted April 26, 2020 Share Posted April 26, 2020 (edited) In case its of any help to anyone.. Migrating PLEX MEDIA SERVER from a FreeNAS Jail to Unraid Docker 1. In the Plex webUI, open the settings and uncheck ‘empty trash after each rescan’. Then save. 2. On the FreeNAS shell, locate your Plex Media Server Jail and its plex related data. In my case, my jail is called ‘plex-plexpass’ and my iocages live on a pool called ‘MEDIA’. Using a terminal shell on the FreeNAS host: root@freenas# cd /mnt/MEDIA/iocage/jails/plex-plexpass/root root@freenas# ls -lrt 3. The ‘Plex Media Server’ directory contains all the Plex config data and database files. This needs to be tarred up before being transferred to the Unraid server. root@freenas# tar -cvf PlexMediaServer_backup.tar “Plex Media Server” 4. Once the Plex directory has been tarred up using the above command, we use rsync to transfer it to the Unraid server. My Unraid server is called ‘unraid’ and the location I will store it in is called ‘backuptars’. Note that I have a local DNS that resolves ‘unraid’ to its IP address. If you don’t have one, use the IP address of your server. Note also that I use the root account on both FreeNAS and Unraid. If you use other accounts, make sure you substitute these for ‘root’ used in this how-to… root@freenas# rsync -auP PlexMediaServer_backup.tar root@unraid:/mnt/disk1/data_migrate/backuptars 5. We also need to decide where the media itself is going to be stored. Assuming this is also going to be moving to Unraid, we need to make sure this too has been shipped from FreeNAS to Unraid. We can use the same rsync command to move the Media directory. The below command assumes our media is stored in a directory called ‘plexmedia’ and that this will be moved to a share called ‘plexmedia’ on Unraid. root@freenas# rsync -auP plexmedia root@unraid:/mnt/disk2/plexmedia/ 6. Next we need to setup a Docker container on Unraid that will be our new Plex media server. I used the ‘Community Applications’ plugin by Andrew Zawadzki to make this easy. 7. From the Plugins section in Unraid, just add the Community Applications plug-in like this: 8. The URL to use is: https://raw.githubusercontent.com/Squidly271/community.applications/master/plugins/community.applications.plg For more information, please see the Unraid forum post: https://forums.unraid.net/topic/38582-plug-in-community-applications 9. Once installed and started, you should see the below in the Docker section of Unraid. 10. In order to map the right container paths to where things are stored on the Unraid directory, we need to change the host path as shown, and then save and apply. 11. Notice that /config is mapped to /mnt/user/appdata/binhex-plexpass, as shown below: 12. This is where the new Plex metadata resides. We will need to overwrite this with the data we transferred over from FreeNAS. First stop the container that is running using the UnraidUI – click the STOP ALL button: 13. Using the terminal shell on the Unraid host, go to the location where the plex configuration data resides: root@unraid# cd /mnt/user/appdata/binhex-plexpass 14. We need to rename the existing Plex Media Server Directory that is already here. root@unraid# mv "Plex Media Server" pms.old 15. Now we need to move our FreeNas Plex configuration (that we transferred from FreeNAS previously to the ‘backuptars’ directory) to take the place of the Plex Media Server directory we just renamed. NB. The reason why we move it here instead of maybe just changing the volume mapping of the docker container, is that future updates of plex may expect certain things to be in certain places… it may well work, but I didn’t want to risk it... root@unraid# mv /mnt/disk1/data_migrate/backuptars/PlexMediaServer_backup.tar . 16. And then we need to untar the file so that we have the Plex Media Directory recreated. root@unraid# tar -xvf PlexMediaServer_backup.tar 17. And then adjust file and directory ownerships: root@unraid# chown -R nobody:users "Plex Media Server" 18. Now start the Unraid Plex Docker container by clicking the START ALL button: 19. Wait a couple of minutes foe Plex to come up and settle, and then using a web browser, browse to the new Plex instance – for me the URL is http://unraid:32400/web 20. Once logged in, the plex library should be visible. However, when trying to play a video, the following error may be seen: 21. This is because the path to the media (as known to Plex from your old instance on FreeNAS) has changed and Plex can no longer find the actual media file to serve. I thought this could be fixed with putting in some symlinks, but this didn’t work for me. So, I just manually mapped my media directories in the PlexUI like this: 22. Press the BROWSE button and browse to the location of your media – for example, for my TV media, it was /mnt/media/TV 23. Plex will rescan the library (which may take a while to complete) and the media should now play. Remember to do the same for all your other media folders, Movies, Documentaries, etc. 24. Finally, re-enable the ‘Empty trash automatically’ feature in SETTINGS>LIBRARY in the Plex webUI and click SAVE CHANGES. PLEX Media Server has now been successfully migrated from FreeNAS iocage Jail to a Unraid Docker Container. 25. Now that everything is up and running, we can delete the ‘pms.old’ directory which we renamed the original Unraid Docker Plex configuration directory to, and also the PlexMediaServer_backup.tar file that we transferred from the FreeNAS server. We use the terminal shell like this: root@unraid# cd /mnt/user/appdata/binhex-plexpass root@unraid# rm -Rf pms.old root@unraid# rm -Rf pms.old root@unraid# rm PlexMediaServer_backup.tar //** There’s probably a better way of doing it that avoids having to rescan your media, but this is what worked for me.. //** Edited April 26, 2020 by jagz707 error 1 Quote Link to comment
trurl Posted April 26, 2020 Share Posted April 26, 2020 Not familiar with FreeNAS jails, but ultimately, your plex docker on FreeNAS would have had host path(s) for the media mapped to container path(s). And on Unraid, your plex docker would have host path(s) for the media mapped to container path(s). The plex library you are transferring is expecting to find the media at the specified container path(s). So, you just need to have the media container path(s) on Unraid the same as the media container path(s) you were using on FreeNAS. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.