Restore a known-good Plex database only with the server stopped, preserve the failed files, and validate the recovered state before running new scans.
A recent backup can be the fastest recovery when the active library database is corrupted, but replacing files blindly can erase useful evidence or introduce a second inconsistent state. Pick a backup from before the first failure, keep copies of both old and new database sets, preserve ownership, and bring Plex up in a quiet validation window. Stop immediately if the restored database shows the same corruption.
Choose the Backup Before You Touch the Active Database
Start with a backup whose timestamp precedes the first known corruption symptom but is recent enough to preserve useful watch state and library changes. Copy both the current database and candidate backup to a safe location before replacing anything. Never experiment on the only remaining copy.
Check available backup copies before replacing the active database. Choose a timestamp from before the first corruption symptom, not simply the newest file.
Record what will be lost between the backup timestamp and now: new library additions can be rescanned, but watch progress, collections, or metadata edits may require manual reconciliation. That tradeoff helps you decide whether a repair attempt is worth trying before replacement.
Stop Plex and Preserve the Failed State
Database files should not be swapped while Plex is actively writing them. Stop the server or container cleanly, verify the process is gone, and copy the current database directory somewhere outside the live application-data path. This gives you a rollback if the selected backup is also bad.
Stop Plex before repair or replacement; stop-and-repair sequencing prevents the application from writing to database files while you are swapping or repairing them.
Do not delete the broken database immediately. Rename or move it with the timestamp intact. If the restore later exposes a different issue, you may need logs, sidecar files, or the failed database to understand what changed.
Restore the Matching Database Files Into the Expected Location
Use the same Plex data directory the working server already expects and restore the database copy with the correct active filename. Preserve permissions and ownership from the live directory. If your backup method captured a consistent database set, restore that set rather than mixing files from different timestamps.
Treat restoring a backup database as one coherent recovery point instead of mixing whichever individual files appear newest.
Before starting Plex, compare owner, group, mode, and file size with neighboring appdata. A restore that accidentally makes the database unreadable will look like another corruption incident. Correct access at the filesystem layer first.
If the backup contains related database files or sidecars from the same recovery point, keep that set together. Mixing files from different timestamps can create a new inconsistency that looks like the original corruption.
Start Plex and Verify State Before Triggering Scans
Bring the server up and inspect the library before asking it to perform large maintenance jobs. Confirm that the web app opens, libraries appear, users and watch state look plausible, and several known titles resolve to valid media paths. A successful process start is not enough.
For an application-consistent recovery point, stopping Plex for consistent backups reduces the chance that the next restore contains a partially written database state.
Only after the restored server is stable should you scan for media added after the backup. Keep the scan narrow where possible. If the database immediately reports corruption again before any scan, stop and choose an older backup or move to a controlled repair path.
Close the Recovery With an Integrity and Backup Test
After the restored database survives normal browsing and a small library update, restart Plex once and verify that state persists. Then create a new backup from this healthy baseline so the next failure does not depend on the same suspect generations.
A backup becomes trustworthy only when state-preservation testing proves that the important Plex state returns in an isolated restore.
Document the backup timestamp used, what state was lost, and what verification passed. If corruption recurs on a healthy restore, investigate storage errors, unclean shutdowns, or a repeatable software trigger instead of cycling through backups indefinitely.
Support & Tips
More to Read

Can Plex Share a GPU With Another Docker Container?
Plex and another container can often access the same GPU, but you must test driver support, device mapping, video-engine load, memory, and recovery behavior.

How to Tell Whether a Plex Error Comes From the Client or Server
Reproduce the same item on another client, compare the session path, then collect server evidence only after scope tells you where the failure actually...

How to Configure Plex Cache and Transcode Temporary Storage
Protect persistent Plex state while placing transcode temp files on suitable local storage, then verify cleanup, free space, and restart behavior.

