Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Any automated backup solutions? Database corruption issue on Plex Docker. Wantr a auto-backup of plex database or any solution that results in the same thing, like backing up the entire docker image or apps dir?

Featured Replies

My plex server database has corrupted and now I need to basically delete it and reinstall the entire thing. This is a huge pain as I do a lot of custom poster art and even renaming of things, and as plex dose not support external NFOs it means redoing the server will mean having to redo all that organizational work. Unfortunately that is where I think I am now.

What I would like to do is have a way to automatically backup my plex database so I have a working version that I can simply restore and then rescan any changes since the last backup. If I can somehow set a regular backup of the plex database, or any other solution that results in the same thing, backing up the entire docker image, or the apps dir or something.

Is there any ways that I can setup a backup of either the plex database, the entire docker image file, or the apps dirs so I have something to go back to?

thanks!

Solved by caplam

  • Solution

easiest way is probably to use appdata backup plugin. It has special features for plex containers.

It will stop the container before backup to ensure a consistent state.

You can also try to repair your database. You will find tutorials for that. For example:

repair a corrupt plex database


## Step 1: Back Up Your Data
Before making any changes, it's crucial to back up your existing Plex database.

1. **Stop the Plex Media Server**:
   - Make sure the Plex server is not running to avoid further corruption.

2. **Locate the Database**:
   - The database file is typically located in:
     - **Windows**: `C:\Users\<YourUsername>\AppData\Local\Plex Media Server\Plug-in Support\Databases\`
     - **macOS**: `~/Library/Application Support/Plex Media Server/Plug-in Support/Databases/`
     - **Linux**: `/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/`

3. **Backup the Database**:
   - Copy the entire **Databases** folder to a safe location.

---

## Step 2: Repair the Database

### Using SQLite Tools

1. **Install SQLite**:
   - Download and install SQLite tools if you don't have them.

2. **Open Command Line**:
   - Open your command-line interface (Terminal on macOS/Linux or Command Prompt on Windows).

3. **Navigate to Database Location**:
   - Use the `cd` command to change to the database directory.

4. **Run SQLite Commands**:
   - Open your Plex database file with SQLite:
     
     sqlite3 "Plex Media.db"
    
   - Execute the following commands to check and repair the database:
     ```sql
     PRAGMA integrity_check;
     ```
     - If errors are reported, you can try:
     ```sql
     .dump
     ```
     - This will dump the database contents.
     - Exit SQLite with:
     ```sql
     .exit
     ```

5. **Create a New Database**:
   - Start a new SQLite database and import the dumped SQL:
     ```bash
     sqlite3 "NewPlexMedia.db"
     ```
     - Then paste the output you got from the `.dump` command.

---

## Step 3: Replace the Old Database

- Rename your existing database file (e.g., `Plex Media.db.bak`).
- Rename the new database (`NewPlexMedia.db`) to `Plex Media.db`.
- Ensure file permissions are set correctly.

---

## Step 4: Restart Plex Server

- Start the Plex Media Server again and check if the issues are resolved.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.