Corrupt Database - Transferring User Information

Correct, the stuff under dashboard → view full history ? If metadata_item_views is the correct table then great, that would be very helpful. I’m not sure which table stores that information. I can also give it a test in the coming days.

Thanks. The support article hasn’t been updated to reflect that history. I’ll look to see about adding that as well. But Volt is right in that it’s that “views” table so the same procedure would work.

1 Like

If you are willing to take a crack at it I would be more than willing to pay you for your time. I’m on version 1.24.4.5081 as I haven’t been able to update since then. The file is too large to upload to you. Is there a way to get it to you?
Thanks again

And the play history is what I am trying to also transfer over

That database file is definitely corrupt. The two-step manual repair process (.dump and .read) fails because portions of it can’t be dumped correctly.

The single-step (.recover) method does complete, but produces 181,014 lost_and_found records. I don’t think you should attempt to use this database after recovery.

Extracting the viewstate and play history seems fine, from the original or after performing .recover on the database.

This will extract both viewstate and play history (replacing the Source Install steps here):

sqlite3 com.plexapp.plugins.library.db ".output settings-views.sql" ".dump metadata_item_settings .dump metadata_item_views"

Copy settings-views.sql to the new install. Or in your case:

  • remove the old database files
  • start Plex, configure your Libraries, scan your media

Replacing the Destination Install steps, here’s how to bring them into a new database:

sqlite3 com.plexapp.plugins.library.db ".read settings-views.sql"

I am on windows

I think I cleaned up the commands so they should be cross-platform. Just fix the path to Plex SQLite.exe.

thank you!

Do I need to change to the database directory in plex media server before running this?

Thanks

Yes, that’s easiest.

Or use the full path to the com.plexapp.plugins.library.db file.

So just want to make sure I’m using the right command after I open the command prompt but I would likely be using this to change to the database directory
“C:\Program Files (x86)\Plex\Plex Media Server\Plex SQLite.exe” com.plexapp.plugins.library.db

After I’ve run sqlite3 com.plexapp.plugins.library.db “.output settings-views.sql” “.dump metadata_item_settings .dump metadata_item_views”

What is the name of the new file that the information gets saved in called that I will eventually extract to the destination install?

Thanks again for all your time.

It will be saved in a new file named settings-views.sql.

in the Plex Media Server, Plug-In Support, Databases folder I’m getting nothing like that. The closest I get is a file called Set with 0 KB data and a recover.out file. Maybe I’m not letting it run long enough?

Are you doing this first?

"C:\Program Files (x86)\Plex\Plex Media Server\Plex SQLite.exe” com.plexapp.plugins.library.db

That would open the Plex SQLite utility in interactive mode.

You don’t need interactive mode. The commands I gave are enough by themselves from the command line.

Here, I think I’ve replaced the paths with complete Windows paths:

# Change to default Plex database path:
cd "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases"

# Export database metadata_item_settings and metadata_item_views tables to settings-views.sql file:
"C:\Program Files (x86)\Plex\Plex Media Server\Plex SQLite.exe"  com.plexapp.plugins.library.db ".output settings-views.sql" ".dump metadata_item_settings .dump metadata_item_views"

That will produce a settings-views.sql file that can later be imported.

On the destination system (or in your case, after rebuilding the database):

# Change to default Plex database path:
cd "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases"

# Import settings-views.sql to active database file:
"C:\Program Files (x86)\Plex\Plex Media Server\Plex SQLite.exe" com.plexapp.plugins.library.db ".read settings-views.sql"

Is that helpful?

1 Like

Thank you that’s exactly what I was doing wrong. Thank you again!

Unfortunately just tried it and maybe it’s because it’s on Windows 11 and not 10 (same Plex media sever version) but I just get error messages.

What’s interesting is that some of the history has transferred over. Now I’m not sure if that’s because I had transferred over the Plex registry a while ago when I first set up Plex on Windows 11 or what the reason is.

That looks like it isn’t being imported to a new/clean/empty database.

If you try to import it back into the same database you’ll get an error like that for every row that exists.

That makes sense. I uninstalled Plex on the other machine but didn’t check to see if it removed all data. I’m sure there was data left behind. Thanks for your patience.

Thank you! I finally managed to get all my user information transferred over to a new install so all is good again in the world.

Thank you again!

1 Like