Plex
A Plex backup has two parts:
- The library database - Plex’s own Download Database export: libraries, metadata, playlists, collections, and every user’s watched state and ratings.
Preferences.xml- the server’s settings and its identity, which shared libraries are tied to. It’s read from Plex’s data folder. Restoring it brings a rebuilt server back as the same server; without it, every shared user has to be invited again.
Images, caches, codecs and plugins are left out; a library scan brings the images back. Include metadata adds the images - see below.
Setting it up
Mount Plex’s data folder - Library/Application Support/Plex Media Server inside its /config, in both the official and linuxserver images:
volumes:
- "/share/Container/plex/Library/Application Support/Plex Media Server:/mnt/plex:ro" # drop :ro to restore from the web UI
Then fill in the card: the URL, the server owner’s Plex token, and Data folder = /mnt/plex.
- URL: Plex usually runs with host networking, so use the host’s address, not
http://plex:32400. If Plex’s Secure connections is Preferred (the default),http://192.168.1.10:32400works. If it’s Required, use the server’shttps://192-168-1-10.<id>.plex.direct:32400address - Plex’s certificate isn’t valid for the bare IP. Backuparr connects toplex.directnames without a DNS lookup, so routers that block them don’t matter. - Token: click Get Plex token and sign in on Plex’s website (your password never reaches Backuparr). It fills in the token, and the
plex.directaddress when the URL is empty or points at the same machine. If the popup is blocked, use the Open Plex sign-in link. You can also find a token by hand.
Backups and restores
- The archive is sensitive:
Preferences.xmlholds the server’s plex.tv sign-in token. - Include metadata on the card adds the
Metadatafolder of Plex’s data folder: posters, artwork and other images, including the ones you uploaded. It’s off by default: most of it downloads again, and it can make each backup many times larger (retention keeps that many copies). It’s many small files, so the backup and its check take longer. TheMediafolder stays out: it holds video preview thumbnails and chapter images, which are large and which Plex rebuilds. - Restore needs Plex stopped (
docker stop plex); Backuparr refuses while it’s running. It replaces the database andPreferences.xml(and theMetadatafolder’s files, if the backup has them), then you start Plex. The backup must come from the same Plex version - see The version check. - Rebuilding a server: start the new Plex once (no need to sign in), stop it, then restore. It comes back as the original server with its shared users; keep the original token in Settings. Never run the original and the restored server at the same time.
- To restore by hand, follow Plex’s guides to restoring the database and moving a server: put
com.plexapp.plugins.library.dbinPlug-in Support/Databases(deleting its-waland-shmfiles) andPreferences.xmlin thePlex Media Serverfolder, and the backup’sMetadatafolder there too if it has one.