Automating Plex Media Server Backups on Windows: A Step-by-Step Guide

In the ever-evolving world of digital media, ensuring the safety of your Plex Media Server data is paramount. Unexpected events can lead to potential data losses, making regular backups an essential practice. Fortunately, if you’re a Windows Server user, automating your Plex backups is a straightforward process. Here’s a detailed guide on how to set up automated backups for your Plex Media Server using Windows Task Scheduler.

Locating Your Plex Data

Identifying Plex Configuration Files

Before diving into the automation process, the first step is to identify the location of your Plex Media Server data. On your Windows Server:

  1. Open Windows Explorer.
  2. Navigate to the directory:
    C:\Users\USERNAME_HERE\AppData\Local\Plex Media Server\

    Replace USERNAME_HERE with your actual Windows username.

If you find files within this folder, you’ve located your Plex configuration data, which contains all necessary settings for your server.

Next, designate a backup location. For this example, we’ll use D:\ as the backup drive. Create a folder named Backups within this drive to store your backups.

Finding Plex Database Files

For a comprehensive backup, you’ll want to back up both the configuration files and the databases. You can typically find the database files in the same primary directory. For individual database backups, navigate to:

C:\Users\USERNAME_HERE\AppData\Local\Plex Media Server\Plug-in Support\Databases\

Again, replace USERNAME_HERE with your username. Confirm this folder contains database files ready for backup.

Creating the Backup Script

Step 1: Write the Backup Script

Creating a backup script is relatively simple and involves using basic Windows Command Prompt commands. Open Notepad on your Windows Server and input the following command for backing up your configuration data:

xcopy "C:\Users\USERNAME_HERE\AppData\Local\Plex Media Server\" "D:\Backups\" /E /I /Y
pause

Make sure to adjust USERNAME_HERE and the backup path D:\Backups to reflect your setup. Save this file as BackupPlexData.bat.

Step 2: Write the Database Backup Script

To back up your Plex database files, create another script. Open Notepad and paste this command for backing up the databases:

xcopy "C:\Users\USERNAME_HERE\AppData\Local\Plex Media Server\Plug-in Support\Databases\" "D:\Backups\Databases\" /E /I /Y
pause

As before, customize USERNAME_HERE and the destination path as needed. Save this file as BackupPlexDatabase.bat.

Automating Backups with Windows Scheduler

Now it’s time to automate the backup process using Windows Task Scheduler:

  1. Open Task Scheduler by searching for it in the Start Menu.
  2. Select Create Basic Task from the Action menu.
  3. In the dialog that appears, name your task—consider using "Plex Backup" as the task name.
  4. Optional: add a description and then select Next.

Configuring the Task Schedule

Choose a schedule for when you’d like the task to run. Options typically include daily, weekly, or monthly frequence. Once selected, refine any additional settings and click Next.

  1. When asked for an action, select Start a program and click Next.
  2. Browse for your BackupPlexData.bat script or the BackupPlexDatabase.bat script you created.
  3. Confirm everything by clicking Next and finish setting up your task.

Your Plex Media Server backups are now automated! Regularly check to ensure that the backups are being created successfully and monitor your drive space to maintain adequate storage.

Conclusion

Automating your Plex Media Server backups on Windows ensures that your media library remains safe from unexpected mishaps. By utilizing Windows Task Scheduler, you can schedule regular backups with ease, allowing you to focus on enjoying your media without worrying about data loss.

Stay proactive with your data protection strategy for a seamless Plex experience!

By Alex Reynolds

Tech journalist and digital trends analyst, Alex Reynolds has a passion for emerging technologies, AI, and cybersecurity. With years of experience in the industry, he delivers in-depth insights and engaging articles for tech enthusiasts and professionals alike.