Database appears to be beyond repair

Server Version#: 1.23.4.4712
Player Version#: 4.63.0

Having a problem that I cannot resolve. I am running PMS v1.23.4.4712 on Windows Server. Thursday night it decided it didn’t want to work anymore. I am getting the following error:
“Plex Media Server unable to open its media database”

I did a repair of the database, didn’t make any difference. I then tried restoring one of my 4 backups and none of those are working either. I am at the point now where Plex runs and I can see my home screen with images but nothing will open. All of my libraries are greyed out with Yellow triangles with ! inside.

What are my options with this? I need to get this up and running. I tried deleting the following files and allowing Plex to regenerate everything figured that is how I would begin a new database but wasn’t certain.

com.plexapp.plugins.library.db
com.plexapp.plugins.library.blobs.db
com.plexapp.plugins.library.blobs.db-shm
com.plexapp.plugins.library.blobs.db-wal
com.plexapp.plugins.library.db-shm
com.plexapp.plugins.library.db-wal

Thanks

Larry

What behavior do you see if you rename %LOCALAPPDATA%\Plex Media Server\ to something else (don’t delete it, just rename it)? Do this with the Plex Media Server stopped; you’ll also need to stop the Plex Update Service in the Windows Services app.

When you restart Plex Media Server after doing this, it should behave like a brand new, already-claimed server, but with no libraries. It should have created a new %LOCALAPPDATA%\Plex Media Server\ folder. Create a library test that the server is functioning properly.

You can undo all of this by deleting or renaming the new folder and restoring the old one.

All that said, you may not need to give up on your old Plex data yet. You didn’t say which older database you restored. Did you try your oldest one? If that one’s corrupt and can’t be repaired, then you may indeed need to start over. Just ensure you’re following these instructions to the letter when trying your older database(s).

Note:

  • This assumes you haven’t moved your Plex data folder (%LOCALAPPDATA%\Plex Media Server\) to somewhere else already. If so, rename whatever folder you’re data’s actually located in.
  • Start the Plex Updater Service once you’re finished.

I can’t do what you are suggesting. I have my %LOCALAPPDATA%\Plex Media Server\ located at P:\Plex Media Server as I wanted it on it’s own drive. I built this 7+ yrs ago and can’t recall how I pointed it at a different location, I think it gets done within Plex itself but since I can no longer access it I can’t redirect it somewhere else so I tried something below, which didn’t work anyway.

The Plex Updater Service is configured to point there as well. I renamed the Plex Media Server folder to _old and created a new folder with the basic plex info in there, plex won’t stay running for whatever reason. It closes immediately.

I have never run into anything this bad before and am totally stumped. :frowning:

The option to configure the Plex data directory location from within the Plex interface was removed, for security purposes. It can still be done manually using the procedure here:

Check inside P:\Plex Media Server\ to see if there’s another Plex Media Server folder; if so, rename that one and leave the top-level one as-is.

I made one change that the post suggested, I moved the P:\Plex Media Server into P:\Plex\Plex Media Server. I still cannot get plex to run, can’t get the Plex Update Service to run either. :frowning:

I made all of the registry changes and still the service won’t start even after a server reboot. hmmm

I didn’t explain that last point very clearly; not at all, actually.

Wherever you point your Plex data directory to, the server itself will expect a Plex Media Server directory to exist (or it will create it). For example, on my own system I have it pointed to C:\Users\myusername\PlexData\. Inside that directory, Plex automatically created Plex Media Server. Step 5 of the forum post I linked explains this.

So, in your example, you should have a directory structure which looks something like this:

P:\
    Plex\    <--- Your registry's LocalAppDataPath should point here
        Plex Media Server\    <--- Not here
            Cache\
            Codecs\
            ...
            Plug-in Support\
            ...

So check your Plex Media Server directory. Does it contain a sub-directory of the same name? Or maybe just screenshot the directory structure an post it here.

No, it does not contain another directory within itself.

P:\Plex\Plex Media Server\Cache\

That’s good then, as long as you have LocalAppDataPath pointed to P:\Plex\.

If that still doesn’t work, then you may want to try removing the LocalAppDataPath registry key altogether as a test; then it will use its default path.

I will try that as a test as my C: drive is a mirrored SSD which is why I moved it to a standalone P: drive.

This is what I have attempted. I deleted the 2 registry entries that were pointing LocalAppDataPath to P:\Plex. I then copied the plex files into appdata\local\Plex Media Server and attempted to start Plex. It didn’t start. First attempt stated it couldn’t find the database so I copied one of the databases into the correct location and that error went away but still didn’t start.

I am at the point where I might just have to start over again. :frowning: What is the best way to do that? Is it possible to save anything from the previous installation such as images/content as well as what has been watched, progress, etc?

Thanks for your help. At this point I need to get this up and running before family kills me. lol

You can use this procedure to uninstall Plex Media Server completely.

Where it tells you to delete the server’s local app data, don’t; just back it up somewhere for safekeeping.

After completing that procedure, just install the latest Plex Media Server as a new installation.

Once you’ve reinstalled Plex Media Server, claimed it, and satisfied yourself that everything is working as it should be, try backing up the new data and moving the old data back (with the repaired/backup database?) and see what happens. (Hopefully it goes without saying that all this data-swapping I’ve been suggesting should take place with PMS stopped :wink: ). You can always move your new, pristine data back if it doesn’t work.

However… Based on what you’ve described to this point, you don’t have a salvageable database, either a via backup or repair. All the interesting things which you are attempting to save are stored there (except certain file-based metadata). If you haven’t got a good database, you’re going to have to start over, unfortunately.

Really appreciate everything you have suggested. Going to attempt the clean installation into a totally different directory on the P: drive and see how it goes. Will update you either way.

thanks again!

Larry

I have reinstalled into P:\Plex\Plex Media Server and have added back 4 libraries. They are being built which could take an hour or so as I have quite a bit of media. Once this is done I will attempt to play something but so far I am seeing things being built which is great!

After I confirm this is working I will backup this new database to a new location and try copying one of my previous databases and see how that works. Assuming that works, what else do I copy over so as to restore the previously watched, etc content or is that all stored within the database itself if that is crap then I am out of luck?

Thanks!

Dependent upon how hosed your old database is, this article may helpful:
https://support.plex.tv/articles/201154527-move-viewstate-ratings-from-one-install-to-another/

That one’s just for view states and ratings; this one describes how to move an entire installation to a new system, which is essentially what’s happening here. However, if you do this, ignore the registry steps since you’ve already blown away your old install.

https://support.plex.tv/articles/201370363-move-an-install-to-another-system/

When doing any of this, I’d recommend stashing you entire new Plex data folder somewhere safe so that you can at least get back to a working system easily should something go wrong.

No problem, and good luck!

I wanted to give you an update on where my server stands and what I discovered.

I am operational 100% on my original database! After I installed Plex to a totally new directory and a fresh database I added 4 libraries as a test and it worked perfectly. I then my old database into there and it worked without any issues. I then relocated Plex to P:\Plex using the new database to confirm it worked and it did without a hitch. I then copied the old database into there and confirmed it too worked without any issues.

It really seems that the entire issue wasn’t a database corruption but was actually a Plex corruption somewhere. Very odd as I don’t recall every reading about Plex corrupting, it is always the database that gets hosed.

Thanks again for all of your help with this. Very much appreciated.

Larry

1 Like

You’re welcome, glad you were able to recover it!

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