this post was submitted on 22 Jun 2023
22 points (86.7% liked)

Selfhosted

40151 readers
547 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I have an Intel NUC running plex media server on ubuntu headless server. It's running beautifully, and barely uses the nuc's resources. The videos are stored on a synology ds923+ NAS.

I'm thinking of adding a couple of new services to the NUC and would like to move to a dockerised setup. This would involve moving the plexmediaserver into a docker.

Is there a good way to do this without having to recreate and rescan all the plex video libraries?

top 10 comments
sorted by: hot top controversial new old
[–] [email protected] 6 points 1 year ago

You can just copy over the Library folder, that should do it. Then set up the plex Docker to use bind mounts instead of volumes and place your old library into that bind mount.

I usually do ~/docker/plex/Library and have the Docker compose file in the ~/docker/plex folder

[–] qwerty 5 points 1 year ago (1 children)

I think this should work? I used this method when migrating my plex server to a lxc container.

[–] DrTeeth 2 points 1 year ago

Cool thanks.

[–] ChrislyBear 4 points 1 year ago

If you use hardware transcoding or similar features, you'll have to find out how to pass the necessary devices through into the docker container!

This tutorial does this (if I read the compose fole right). https://drfrankenstein.co.uk/2021/12/06/plex-in-docker-on-a-synology-nas-hardware-transcoding/

Not sure if it is any good, I haven't tried it.

[–] [email protected] 2 points 1 year ago

It should be possible. Something like this:

1.	Backup your Plex database located at /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/.
2.	Install Docker on your NUC.
3.	Pull the Plex Docker image using docker pull plexinc/pms-docker.
4.	Run the Plex Docker container, pointing it to your Plex database and media files. Example command:

docker run
-d
--name plex
--network=host
-e PLEX_CLAIM="<YOUR_PLEX_CLAIM>"
-e ADVERTISE_IP="http://:32400/"
-v <PATH_TO_PLEX_DB>:/config
-v <PATH_TO_MEDIA>:/data
plexinc/pms-docker

4.	Replace <YOUR_PLEX_CLAIM>, <YOUR-SERVER-IP>, <PATH_TO_PLEX_DB>, and <PATH_TO_MEDIA> accordingly.

Make sure the Synology NAS is mounted on the host and passed as a volume to the Docker container. This should maintain your existing Plex libraries.

[–] ridel 1 points 1 year ago

I accomplished this and found it was pretty easy. Like everyone else said, just point the volumes to the right directories. Backup your Plex data (not the media) a few times in case you screw up and it starts to index existing files as if it were old files.

Probably the hardest part for me was 'claiming' the server using their startup token. And even then that was fairly easy.

You're hosting on Ubuntu so this isn't a problem, but PMS basically requires its own IP on your intranet (not the Docker internal subnet) so Mac's Docker implementation fails to provide this capability.

[–] [email protected] 1 points 1 year ago (1 children)

I run everything but Plex in docker on a NUC. Plex runs right on my Synology as a package. If you go this route you should know the version in Synology is quite a few releases back, but you can easily do a manual install in package center to get the latest Plex version.

[–] DrTeeth 1 points 1 year ago

I originally migrated plex away from the NAS, because I wanted to upgrade to a non intel based NAS (ds923+ is a ryzen based setup. So no hardware transcoding). I'm super happy with the NAS , and by moving plex to the NUC I have freed my self from Synology NAS chip restrictions.

Also plex works better than it ever has on a synology.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

If you're planning to mount the data directories on the host for your docker setup it should be relatively straight forward I think, docker volumes a little less so. Thinking through it, you'll need to run the container first time with the volumes mounted wherever you like so the container will populate the host mounted data directory with the folder structure, initial database, config file(s) logs, cache, etc. Then it should be as simple as backing up the initial data files just in case, swapping in a copy of the database you've got already got running, the config .xml? I believe, the cache directory, and the logs if you'd like. It's been a while since I've had Plex deployed so I could certainly be missing something though.

Edit: create -> run

[–] snekerpimp 1 points 1 year ago

I am far from an expert, but if you just point your volumes to the right directories, it will be like nothing ever happened.

load more comments
view more: next ›