Migrating docker install

Dear people from plex!

Recently i wanted to migrate my docker to place the config files somehwere else since the data is getting bulky. Been running plex on docker without issues thus far. As i was working with docker i thought this would be easy but i ran into some problems.

Setup:

  • Ubuntu 20.04 LTS
  • Docker 19.03.8
  • Latest plex docker image

Steps ive done (for full commands see below):

  1. Stop running PMS
  2. created a folder on my NAS which i acces through cifs share; same NAS as where my media lives, only different folder.
  3. Copied the config and transcode folders to their new destination (cp -a -v -L method)
  4. Start new docker container with similar commands as previous working container, only new locations of files.

Then it takes about 2 minuts of starting before it says “unhealthy”. Also tried step 4 with adding UID and GID.

The docker logs i see are these:
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 40-plex-first-run: executing…

When i go to the webadress (same one as old container) i get a 502 error.

Docker command for working container:
docker run -d --name plex --network=host -e TZ=“Europe/Amsterdam” -v /home/wouter/docker/plex/config:/config -v /home/wouter/docker/plex/transcode:/transcode -v /MEDIA/:/data plexinc/pms-docker

Docker command for intended new container:
docker run -d --name plex_live --network=host -e PLEX_UID=0 -e PLEX_GID=0 -e TZ=“Europe/Amsterdam” -v /MEDIA/Software/DOCKER_LIVE/plex/config:/config -v /home/wouter/docker/plex/transcode:/transcode -v /MEDIA/:/data plexinc/pms-docker

Commands for copying the files to the new folder:
cp -a -v -L /home/wouter/docker/plex/config/* /MEDIA/Software/DOCKER_LIVE/plex/config
cp -a -v -L /home/wouter/docker/plex/transcode/* /MEDIA/Software/DOCKER_LIVE/plex/transcode

Okay to answer my own question for future reference:

It appeared my lack of patience got the better of me here. Left it running for some time, just to see. Earlier had it running for 10 mins without result. But after ~90 minutes it came up and running and shows health!

Probably depends on the size of your database :slight_smile:

Good luck all!

I presume this means that you’ve put the /config and by extension the database on this CIFS share. Don’t put the database on a CIFS share as this will result in database corruption.

How and why will this result in a corrupt database? I now got it running without issues and indeed; it is on a CIFS share now.

CIFS doesn’t support file-locking mechanisms properly. These are required for the database to maintain consistency. You are taking a chance on every single database write and eventually you will end up with a corrupt database. There are numerous examples of this in the forums if you don’t believe me.

I do believe you, and thank you for your answer!

Was just curious about the mechanic. Seems i am going to adjust it once again and setup a NFS share to do this properly. Gotta love this hobby tinkering :slight_smile:

NFS may not yield you any better results. It’s possible to setup local locking but some have reported db corruption still occurs there.

To add to Gbooker02,

NFS isn’t going to be any better than CIFS.

If you want the database to remain intact, keep it on a machine-local file system.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.