Library Restore After Clean Install

Server Version#:
Player Version#:

I recently installed a fresh install of Plex Media Server on Ubuntu after removing the old install including all of the data and database files. I had a backup of the library database, but when I add the file to the database folder it breaks the server. I checked and Plex is the owner of the file. Any thoughts?

How much of it did you “remove”? Did you remove user plex completely? Did you remove “/var/lib/plexmediaserver” ?

Yes, I deleted everything.

  1. Make certain user plex has also been deleted (userdel)
  2. Fresh install PMS and let it create the base environment again for you.
  3. Once installed,
  4. Stop it
  5. cd /var/lib/plexmediaaserver
  6. sudo mv Library Library.unused
  7. untar / unzip your backup there
  8. sudo chown -R plex:plex . to set ownership again.
  9. Now start it normally.

I only have the library.db file as a backup and it’s not a zip. Do I just paste it into that folder?

Nope. start over.
It’s more effort to use just that DB than it is to start from scratch

proper backup makes a ZIP or tar.gz of ./Library

So there isn’t a good way to restore my watched/unwatched and newly added data?

AFTER you build up a new system, we can transfer the watched status.

As you stand right now, you have no existing metadata at all.
You only have a database with pointers to non-existing media linkages.

Sorry for the analogy? You have the easter egg but don’t have the basket to put it in.

Ha, I appreciate the analogy. So I do have a fresh install and all metadata has been downloaded. The install works, but if I try to replace the library.db file then it breaks the new install. If I revert back to the newly created library.db then it works again. I was hoping there is a way to use the old library.db with the new install.

You can’t replace the existing database and expect it to work.

You must export the watch history from it and import into the new database.

The old DB is the source.
The current DB is the destination.

Gotcha. And I assume the newly added status of a file is a victim to the new install since all files are newly installed?

Correct. All the status values will be incorrect because, as far as the DB is concerned, you’ve never watched any of it until you insert the history (which added the watch history).

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