Skip to content

Fast, quiesced Plex DB mirror for Windows using Robocopy. Stops Plex safely, mirrors with sane excludes, restarts, logs, and exits cleanly

License

Notifications You must be signed in to change notification settings

peter2cfu/plex-db-mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plex DB Mirror (quiesced)

Fast, safe nightly mirror of the Plex data folder to a network share on Windows. Briefly quiesces Plex (stops Updater → stops Server), runs a tuned Robocopy mirror, then starts Plex (Server → Updater). Optimised for LAN/NAS targets and busy libraries.

Latest release: v1.0.0

Quick start

  1. Find your service names (they vary):
    Get-Service | ? DisplayName -like 'Plex*' | Select Name,DisplayName,Status
    # e.g. PlexService (server), PlexUpdateService (updater)
  2. Edit the top of scripts/PlexData-Backup-Quiesced-MIN.cmd:
    set "SRC_LOCAL=G:\Plex Media Server"
    set "DEST=\\YOUR-NAS\backups\PlexData"
    set "PLEX_SVC_NAME=PlexService"
    set "PLEX_UPD_NAME=PlexUpdateService"
    set "THREADS=12"
  3. Dry-run once (no changes): set DRYRUN=1 in the file and run it.
  4. Schedule nightly (Windows Task Scheduler):
    • Run whether user is logged on or not
    • Run with highest privileges
    • Action: cmd.exe /c "C:\Scripts\PlexData-Backup-Quiesced-MIN.cmd"
    • Start in: C:\Scripts
    • Stop the task if it runs longer than 1 hour

Why it’s fast & safe

  • Robocopy: /MIR /J /XJ /FFT /MT /R:1 /W:1 (+ excludes for cache/codec/log noise)
  • Local source path (avoid SMB loopback), UNC destination
  • Clean exit codes: 0/1 = success; >=8 = failure (good for schedulers/monitors)

Troubleshooting

  • Service didn’t stop/start: use the service name (not the display name).
  • Endless re-copies on NAS: keep /FFT (2s timestamp tolerance).
  • Slow copies: avoid /Z; add AV/Defender exclusions for SRC/DEST; on VMs use VMXNET3.

Files

License: MIT — use, tweak, share.

About

Fast, quiesced Plex DB mirror for Windows using Robocopy. Stops Plex safely, mirrors with sane excludes, restarts, logs, and exits cleanly

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published