Options to backup Plex Media Server directory

Server Version#: 1.18.4.2171
Player Version#: 4.20.1

What are some options for backing up the Plex Media Server directory? I would like to start backing it up but would like to know some different options from people so that I could find one that works for me.

I have a Win 10 box. If this matters, my server is also on my main computer that I use everyday (i.e. I don’t have a dedicated box for the server). I have a new 4TB external My Book hard drive for this purpose. I currently back up my data files with a versioning type of backup program but for the Plex Media Server directory, I think I may need a “get the whole directory at one time” type of backup. Also, do I need to stop Plex before I back it up?

Any thoughts?

This is my approach for Windows Server.

As I do have a dedicated NVMe disk for transcoding on my server, I have created a Junction under Plex user profile that redirects Plex Media folder to this drive also (believe it or not, this is for me a great approach, when library goes large and Plex needs to access the database or you need to enable detailed logging), yes, I know that this path can be moved from inside the product, but in case of trouble and suppose PLEX cannot start, you will not be able to change it anymore, so for me it is better approach to keep installation paths as default as possible.

Next thing to do is prepare a little script (if your backup application does not allow you to execute commands before/after operation) that stops Plex just before backing it up, and when finished, just re-launch it… you do not really want to backup even if using VSS an opened database, if you need to restore it you will most likely have a corrupt database.

Backup procedure for me is as simple as compressing the full folder (actually trying to see if with gz compression I achieve better results than with fast/standard zip), as I use a PowerShell script with a scheduled task, this can be customized as much as the time I want to expend on it.

As for the contents I would recommend only excluding Logs folder, at first I also excluded updates, but with time it has proven to be best practice to keep it in case you need to rollback to an older version.

Forgot to mention, always try to backup together “Program Files” folder and “Appdata”, this will ensure that everything is in sync, and this does not suppose a great difference on sizing as the problems you could have restoring a v1.16 database to a v1.19 version where significant changes could have been performed to the data structure.

Future enhancements… upload the gz file to the cloud, so I can keep a networked copy of the folder in case of total disaster recovery scenario :stuck_out_tongue_winking_eye:

I just use Acronis and backup the entire box. It was much faster than using something like Goodsync to just do a back up of the PLEX folder as mine has millions of files and folders in there and it took forever to back up.

Agree, this is the fastest method.

Anyway if space and number of copies to keep in time are a matter of concern you will be more comfortable with a more granular copy, I use to keep 10 weekly copies. I am not the only one that modify the library so I feel safe with a two months threshold just in case I find someone has messed up something and do not know when (also remember the opened database, you cannot backup data on memory)

  1. You mentioned to also backup the “Program Files” folder. Are you referring to the “c:/program files (x86)/plex/” directory? If not, then which one? If so, then wouldn’t that just be created when you install the program, and not have to actually be backed up? If you wanted to ensure that you restored the correct version of program, don’t you already have a list of program updates in the App Data directory?

I just had a thought. Would it be okay if I backup the “/App Data/Local/Plex Media Server/” directory without stopping Plex and then use the latest internally backed up version if I needed to restore? Plex usually keeps 3 backed up versions of the database. If I needed to, could I just copy the most recent saved backup to become the “live” one? Would I only be out a few days of changes?

Only if you take a point-in-time snapshot of the directory. For more info, google VSS backup or shadow copy. It can be enabled in Win 10 (not on by default I believe). Save yourself the hassle and install Veeam for Windows Free Edition. I use it to do exactly exactly what you’re trying to do. Dead easy to set up. With it, I backup nightly a Windows data disk containing my Plex database and media to a NAS share. Works brilliantly. Note the free edition limits you to just one job and there are some other minor caveats, but it fits the bill perfectly here.

Don’t forget to backup PMS settings in the registry as well.

https://support.plex.tv/articles/201539237-backing-up-plex-media-server-data/

1 Like

Well, reinstall/restore, is not the same as going back to a point in time, also you have two sets of data, user data (appdata folder) and program data (programfiles folder) to get back an have a fully working PLEX you need both, the difference between installing or just recovering are just a few more steps :blush:

In my experience when talking about databases it is better to keep everything in sync. As @basilh points out, also registry keys could be needed, but as long as backup software do not use to allow this (just System State), if you go for the script approach you should consider to add some lines for exporting keys just after stopping PLEX.

For simplicity, yes, you can just rely on the automated copies that PLEX stores, anyway I have been checking sqllite documentation and it turns out that it should be robust enough if you copy altogether with the database the wal/shm files, so unless you have a very big PLEX library with a lot of users accessing constantly… make your life easier. :stuck_out_tongue_winking_eye:

Have you seen https://github.com/alekdavis/PlexBackup ?

@cr.gomezm,

Can you (or someone) answer a couple of additional questions about backing up the Plex Media Server?

  1. Specifically what command do you use to shutdown and start the Plex server? Reading through the forums a bit, it appears that there is no gracefull command line option to shutdown the Plex Server. True? Are you just using the taskkill method?

  2. Is the AppData folder you are referring to: %LOCALAPPDATA%\Plex Media Server? and Then everything under C:\Program Files (x86)\Plex? That’s it?

  3. Others have mentioned backing up the Windows registry entry. Are you doing that as well?

I believe my library metadata (not the videos themselves) is stored under E:\PlexData\Plex Media Server. I set it up ages ago, and can’t find where that location is held in Plex itself. Is there a place in the Plex UI that lets you see that?

That E:\PlexData\Plex Media Server location is 78GB and 250,000+ files! You’re saying I don’t need to back up anything in that folder when I do a backup? So if disaster strikes, I have to restore the C:\Program Files folder, the %LOCALAPPDATA% folder, and then Plex will basically re-download all of my metadata (posters, episode names, other metadata, etc.)?

I have briefly looked at the Plex Backup utility mentioned by @alekdavis. I was hoping to be able to just shutdown the app, backup a few folders and be done, but if it ain’t that easy, maybe I’ll look more closely at that backup utility.

Thanks!

@brian.biggs

I was hoping to be able to just shutdown the app, backup a few folders and be done

If only it were that easy. :slight_smile:

Yes.

That is the program folder and doesn’t need to be saved, because it can be restored by running the downloaded installer.

Not anymore. You need to look into the registry.
See [HowTo] An extended guide on how to move the Plex data folder on Windows

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.