# Restore a Database Backup

[https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/](https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/)

One of the many Scheduled Tasks that a Plex Media Server performs is to make regular backups of the core databases, which hold things such as your viewstate information and media matching details.

**Related Page**: [Scheduled Server Maintenance](https://docs.coltscomputer.services/books/plex-tautulli-and-arrs/page/scheduled-server-maintenance "Scheduled Server Maintenance")<a id="bkmrk-" name="toc-0"></a>

## Finding the Database Backups

The location of the database backups will vary by operating system. Unless you’ve altered the location via the <var>Backup directory</var> advanced setting, you’ll find the backup files under the `Plug-in Support/Databases` subdirectory inside the normal [server data directory](https://docs.coltscomputer.services/books/plex-tautulli-and-arrs/page/where-is-the-plex-media-server-data-directory-located "Where is the Plex Media Server data directory located?").

The database backups will have the date in the filename and will be named along the lines of:

```
com.plexapp.plugins.library.db-2020-05-31
com.plexapp.plugins.library.db-2019-06-01
```

and

```
com.plexapp.plugins.library.blobs.db-2020-05-31
com.plexapp.plugins.library.blobs.db-2019-06-01
```

**Related Page**: [Where is the Plex Media Server data directory located?](https://docs.coltscomputer.services/books/plex-tautulli-and-arrs/page/where-is-the-plex-media-server-data-directory-located "Where is the Plex Media Server data directory located?")<a id="bkmrk--2" name="toc-1"></a>

## Restoring a Backup

Once you’ve found the backup you wish to use:

1. Stop/quit your Plex Media Server
2. Move the following files out of the directory and store them somewhere for backup, just in case. (You don’t want the “-shm” and “-wal” files to remain in the databases directory when restoring the corresponding database.) ```
    com.plexapp.plugins.library.db
    com.plexapp.plugins.library.db-shm
    com.plexapp.plugins.library.db-wal
    ```
    
    and
    
    ```
    com.plexapp.plugins.library.blobs.db
    com.plexapp.plugins.library.blobs.db-shm
    com.plexapp.plugins.library.blobs.db-wal
    ```
3. Duplicate the database backup file into the correct directory and then rename them to `com.plexapp.plugins.library.db` and `com.plexapp.plugins.library.blobs.db`.
4. Ensure that Plex Media Server has read/write permissions to the restored database file(s) (e.g. in a Linux install, the `plex:plex` (user:group) needs access)
5. Start your Plex Media Server