How I Backup My Plex Server

One of the most important tasks you will need to do when managing a Plex server is the task of backing up your Plex data. Rebuilding your Plex server from scratch, and losing important files is not something you should need to worry about.

The good news is that backing up your Plex server can be done easily, but it does take some thought into how you go about doing it.

In this post, I will explain a backup strategy, a method I employ to help with backing up my files, and then how I go about implementing my Plex server backup.

How I Backup My Plex Server

The 3-2-1 backup strategy

Before I begin talking about how I back up my Plex server I must touch on both a well-known backup strategy and the method I use to make the strategy work.

If you are familiar with backing up data then you may have heard about the 3-2-1 backup strategy. This is the most common concept for making backups of your files.

The 3-2-1 backup strategy is that you have three copies of your data, with the copies stored on two different types of storage media, and one copy is stored offsite.

For those who are new to backing up data, this may seem like a lot of work, but it isn't. My current Plex backup method employs the 3-2-1 backup concept, and it is completely automated, so I don't need to think about backing up my files regularly.

I won't go into great detail on this strategy as there is a lot of information online about it, but I will explain how I achieve this when I discuss by Plex backup strategy.

The COAT method

To make my life much easier when it comes to backing up my data, I use the COAT method. The name is one I made up, so you won't find it anywhere online, but it is an acronym for everything that I feel needs to be done to make it easier to back up my data.

The COAT method stands for:

  • Consolidate. It is much easier to back up files that are stored in as few locations as possible. To do this, it is best to copy your files to a single or two drives and then back up those drives.
  • Organize. Once you have consolidated your files, you should organize your files into directories. You may find duplicate files you can remove, which will reduce the amount of data you need to back up.
  • Automate. Have your backup run automatically, either through a scheduled job or when a new file has been created or changed. Don't rely on remembering to manually backup your data.
  • Test. Every month or two restore some of your files to make sure the backups are working properly. If you don't test, you may find out too late that you don't have backups for your data. I recommend you perform tests manually as you will probably restore files manually when you need to, so knowing the process of restoring is important.

I use the COAT method to make it easier to employ the 3-2-1 backup strategy and ensure that I can restore my files if needed.

My Plex backup strategy

My backup strategy has evolved because it has been a learning experience for me. I will discuss my current backup process and how I use the COAT method to employ the 3-2-1 backup strategy to ensure I keep my Plex data and files safe.

What needs to be backed up?

Before automating my backup process I first need to determine what needs to be backed up. I don't back up all the files on my Plex server because I don't need copies of all the files.

For Plex, you only need to back up the data directory and the advanced settings from the server. That is all that is needed to restore your Plex server, minus the media files.

I also don't need to backup all my media files as I can re-acquire them when I need them, although it will take some time. Movie and TV show files are large so I save time and drive space by only having them mirrored between two drives, but are not included in my backup.

Family photos and videos, of course, are a completely different matter as I can't reproduce those, so they are backed up. I also backup my music files because I had already been doing that for years, and they don't take as much space as movies and TV shows. I could treat music the same way, but I chose to back them up.

My Plex server also contains all files that I backup from other devices, such as laptops, desktops, and mobile devices which is part of the consolidation of my files. I include these files in my backup process, as well.

Software used for backup

The backup process I use requires some software to automate the backup process. Below is a list of software I currently use:

  • Duplicacy. This application backs up my files onto a local hard drive as well as to additional hard drives twice daily. It does require a license, but it is not expensive and I find it well worth the price.
  • Backblaze. For offsite backup, I use Backblaze and have been using it for over 10 years without any issues. There is a monthly cost, which I don't mind paying as it provides me with a backup tool that will automatically upload my files offsite. They charge a flat rate for unlimited data, and at this time I have just under 2 TB backed up with them.
  • FileWatcher This is an application I developed to monitor folders and files on my Plex server. I use this tool for a few reasons, including for my backup process. It is open source and free.
  • FileVerification Another tool I developed. This one is used to generate a hash of all files in a folder. This hash is used to test/verify the files backed up to ensure the backup is working properly.

In addition to the above applications, I also use tools that are included with Windows, such as robocopy and reg to help back up my Plex data files and settings.

My backup process

I have automated my entire backup process (remember the 'A' in the COAT method), so I don't need to remind myself to back up any files.

My process is as follows:

  1. I run both robocopy and reg in a batch file to back up my Plex data and settings. The batch file is as follows:
    @echo off
    reg EXPORT "HKCU\SOFTWARE\Plex, Inc." "C:\Users\{plex_user_id}\AppData\Local\Plex Media Server\plex.reg" /y > C:\ProgramData\Backup\Plex\Logs\settings-backup.log
    robocopy "C:\Users\{plex_user_id}\AppData\Local\Plex Media Server" "I:\Backups\Plex\Plex Media Server" /mir /r:3 /w:5 /xd "C:\Users\{plex_user_id}\AppData\Local\Plex Media Server\Cache" "C:\Users\{plex_user_id}\AppData\Local\Plex Media Server\Crash Reports" "C:\Users\{plex_user_id}\AppData\Local\Plex Media Server\Diagnostics" "C:\Users\{plex_user_id}\AppData\Local\Plex Media Server\Logs" "C:\Users\{plex_user_id}\AppData\Local\Plex Media Server\Updates" "C:\Users\{plex_user_id}\AppData\Local\Plex Media Server\Media\localhost" /log:C:\ProgramData\Backup\Plex\Logs\backup.log
    I exclude the Cache, Crash Reports, Diagnostics, Logs, Updates, and localhost folders as they aren't needed to restore Plex, and it reduces the amount of drive space needed for the backup. The batch file is stored on the same drive as the one that is being backed up so I will be able to restore the backup file if needed.
  2. FileWatcher is configured to monitor all the folders that I would like to backup. When a file is created in those monitored folders then FileWatcher will call FileVerification to generate a hash of the file. The hash is stored in a text file in the same folder as the file.
  3. Backblaze, which is installed on the server, will automatically backup any new or changed files to its cloud storage for offsite backup. The files containing the hashes generated by FileVerification are also backed up.
  4. Twice a day, Duplicacy will backup those same files to a local hard drive and one of two portable hard drives. The portable hard drive is switched out every month with a second one. When not connected, the portable drive is stored offsite.
  5. To test my backups, I would select folders from either the Backblaze offsite backup or the Duplicacy local backup. I then run the FileVerification application against the restored folders which will compare the hash of the files in that folder to the value in the hash file that was also restored in the folder. If the two hashes match, then the backup was successful.

Except for the Plex data files, all the files are located on two mirrored hard drives using DrivePool, so both Backblaze and Duplicacy back up from those two drives.

All the steps outlined above require no manual work from me (besides setting up the applications). The entire process is automated except for the backup test/verification.

With the above backup process, I have at least four copies of my files - the original, one stored with Backblaze, another on a local hard drive using Duplicacy, and another on one of two portable hard drives also using Duplicacy.

I also have copies both local and in the cloud (Backblaze), and two copies offsite: Backblaze and one of the portable hard drives.

Final thoughts on backing up Plex

Plex doesn't require much to backup, outside of the media files. Just the data directory and the settings are all that is required to backup.

It is important, however, to ensure you backup all the files that are important to you. I have outlined my backup process above, but you will need to create a process that will work for you.

If you can find a process that works for you then you will be able to restore your files when you need them most.

Photo of Paul Salmon
Started managing a Plex server in November 2014 and has been sharing his experience and what he has learned on Plexopedia. He is exploring and documenting the Plex API to help automate tasks for Plex to reduce the management effort of his server.

Dialogue & Discussion