Skip to main content

Restore a Database Backup

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.

Finding the Database Backups

The location of the database backups will vary by operating system. Unless you’ve altered the location via the Backup directory advanced setting, you’ll find the backup files under the Plug-in Support/Databases subdirectory inside the normal server data directory.

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

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