Back Up a Media NAS Without Losing Plex or Jellyfin
In this article
Backing up a media NAS that runs Plex or Jellyfin is more than copying files—it’s about preserving the entire media experience: libraries, watch history, user ratings, and metadata. If you only copy the media files, you’ll have to rebuild your server from scratch after a drive failure. This guide walks you through a safe backup that keeps your media libraries intact, so you can restore everything to a new NAS or server without losing your setup.
What You'll Need
- A second storage destination (external drive, another NAS, or cloud storage) with enough space for your media and metadata.
- SSH or a file manager on your NAS (most NAS systems like Synology, QNAP, or TrueNAS have SSH built in).
- Access to the Plex or Jellyfin settings in your web interface.
- Optional: a backup tool like rsync (usually pre-installed on Linux-based NAS) or a cloud sync utility.
Step-by-Step
- Stop your media server temporarily (or pause library scans). This prevents database changes while you copy. In Plex, go to Settings > Library and disable “Scan my library automatically.” In Jellyfin, go to Dashboard > Libraries and uncheck “Scan library automatically.” You can also stop the service entirely via your NAS package manager.
- Identify where your metadata and configuration are stored. For Plex, the default location is typically
/var/lib/plexmediaserver(on Linux) orPlex Media Serverfolder in your user directory. For Jellyfin, it’s usually/var/lib/jellyfinor~/.local/share/jellyfin. Check your NAS’s documentation to confirm paths. - Back up the media files first. Use rsync to copy your media folders to the backup destination. Example:
rsync -avh --progress /volume1/media/ /volume2/backup/media/
This preserves file permissions and timestamps. If you have a large library, run this during off-peak hours. - Back up the metadata and configuration. While the server is still stopped or paused, copy the entire metadata folder. For Plex, that includes
Plug-in Support,Preferences.xml, andMediafolders. For Jellyfin, copydata,config, andmetadatafolders. Use rsync again to a separate backup folder. - Export your library settings (optional but recommended). In Plex, you can use the “Export” feature in the library settings to save playlists and settings. In Jellyfin, you can back up the entire
configfolder which contains user settings and preferences. - Verify the backup. After the copy, check that the file counts and sizes match. Run
rsync -avh --checksumto compare checksums, or simply spot-check a few files. - Restart your media server. Re-enable automatic scanning if you disabled it, and ensure everything runs normally.
- Schedule regular backups. Set up a cron job or use your NAS’s built-in backup scheduler to run the same rsync commands daily or weekly. This ensures you never lose more than a day’s changes.
Common Mistakes
- Backing up only media files. Without metadata, you lose watch history and custom library settings.
- Copying while the server is actively scanning. This can corrupt the database. Always pause or stop the server first.
- Using a backup destination on the same physical drive. If the drive fails, you lose both copies. Use a different NAS, external drive, or cloud.
- Ignoring database integrity. If you’re using SQLite, a corrupted database can break the backup. Run a consistency check before copying.
Tips
- Use
rsync --deletecarefully: it removes files in the destination that are not in the source, which is useful for exact mirrors but can delete things you want to keep. Only use it if you intentionally want a mirror. - For Plex, consider using the built-in “Backup” feature in Settings > Troubleshooting, which creates a zip of the database.
- For Jellyfin, you can use the “Backup” plugin to automate metadata and database backups.
- Keep at least two backup generations (e.g., last week and last month) to protect against corruption that goes unnoticed.
- Test a restore on a spare machine or VM before you need it. This ensures your backup is actually usable.
Troubleshooting
Backup fails with “Permission denied.” Ensure you’re running rsync with sudo or as a user with read access to the source folders. On Synology, use the admin account or grant permissions via Control Panel.
Metadata backup is huge. Plex can generate many thumbnails. You can exclude the Thumbnails folder to save space—they’ll regenerate on restore, but it will take time. Or increase your backup storage.
Restore doesn’t show watch history. Make sure you restored the entire Plug-in Support folder for Plex, not just the database. For Jellyfin, ensure the data folder is intact.
Server doesn’t start after restore. Check file ownership. The media server runs as a specific user (e.g., plex or jellyfin). After restoring, run chown -R plex:plex /path/to/plex to fix permissions.
Frequently Asked Questions
Q: Can I back up while Plex is running?
A: It’s risky. The database may be in use, leading to corruption. Pause scanning or stop the server for a clean backup.
Q: Do I need to back up the media files if I can re-download them?
A: If you can re-download, you can skip the media and just back up metadata. But remember that re-downloading may take time and bandwidth.
Q: How often should I back up?
A: At least weekly, or after major changes like adding many new items or adjusting library settings.
Q: Can I use cloud storage like Google Drive for backup?
A: Yes, but be mindful of file size limits and bandwidth. For large libraries, a local external drive or second NAS is faster and more reliable.
Q: What if my NAS has only one drive?
A: You can still back up to an external USB drive or a cloud service. The key is to have a separate physical destination.
Q: Will restoring metadata work on a different NAS model?
A: Generally yes, as long as the paths are the same or you adjust them. Plex and Jellyfin are cross-platform, but you may need to update the library paths after restore.