Use this when media moves to a new path and you want Plex to keep watch history, metadata, and collections instead of rescanning everything as new.

Before You Begin

  • Run Compose commands from docker/stacks/nexus so DOCKER_HOST targets nexus.
  • Plex config lives at /mnt/data/plex on the host and /config in the container.
  • Media is mounted at /media inside the container.
  • Know the old and new path prefixes as Plex sees them, for example /data/movies and /media/movies.
Plex must be stopped while you edit the database. Editing a live database can corrupt it.

Change the Paths

1

Stop Plex

2

Back Up the Databases

On nexus:
3

Open the Library Database

Use the SQLite build that ships with Plex. It includes extensions the stock sqlite3 lacks. Run it as the Plex user so new files keep the right owner.
4

Preview, Then Rewrite

Check what matches before you change anything.
Rewrite file paths and library folders in one transaction.
Repeat for each moved library, such as /data/series to /media/series.
5

Start Plex and Verify

Wait for the container to report healthy, then play one title from each changed library.

Roll Back

If Plex fails to start or titles show as unavailable:
  1. Stop Plex with docker compose stop plex.
  2. Replace Databases with the Databases.bak-<date> copy.
  3. Start Plex with docker compose start plex.
Don’t empty the Plex trash or run Clean Bundles until playback works. Either action permanently removes items Plex thinks are missing.