# Upgrade to 1.40 database issues

**URL:** <https://forums.plex.tv/t/upgrade-to-1-40-database-issues/889145>\
**Category:** Plex Media Server\
**Tags:** server-windows\
**Created:** [September 22, 2024, 9:35am UTC](https://forums.plex.tv/t/upgrade-to-1-40-database-issues/889145 "2024-09-22T09:35:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddycj](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@eddycj](https://forums.plex.tv/u/eddycj)\
**Post date:** [September 22, 2024, 9:35am UTC](https://forums.plex.tv/t/upgrade-to-1-40-database-issues/889145/1 "2024-09-22T09:35:02Z")

</div>

Server Version#: Upgrading from 1.32.8.7639 to any 1.40 versions  
Player Version#: using web  
\<If providing [server logs](https://support.plex.tv/articles/200250417-plex-media-server-log-files/) please do NOT turn on verbose logging, only [debug logging](https://support.plex.tv/articles/201643703-reporting-issues-with-plex-media-server/#toc-1) should be enabled\>

I originally posted in this thread earlier this year and transparently, none of the solutions posted worked for me.

When I followed ChuckPA’s instructions this is what happened:

 ![image](https://global.discourse-cdn.com/plex/original/4X/2/5/b/25b709602081f6f21f0539bcdc0da78c3e0d51b2.png)

I then re-tried upgrading to a 1.4x version (in this case 1.41.0.8992). This gives me the following error where media server tries to upgrade, gets about 40% through, and then errors.  
 ![image](https://global.discourse-cdn.com/plex/original/4X/d/4/1/d41b5f96cc31015c466eed7faa0f662494af37bb.png)

And here are the logs:  
[Plex Media Server.log](https://forums.plex.tv/uploads/short-url/c6MJejLX3w7XMLXuvuzlJCQidk3.log) (65.9 KB)

I then tried using ChuckPA’s DB repair tool and it wiped out my database entirely. My DB file was ~350MB and Blobs was ~640MB. After running ChuckPA’s DB repair tool, my DB file went to 0KB and my Blobs file went to 650 MB. This is what the DB repair tool says:

 ![image](https://global.discourse-cdn.com/plex/original/4X/d/6/3/d639e692df1ca0aab5c9c49330aaa7ee25c30387.png)

But given my DB file has been wiped clean through this process, Media Server doesn’t even try to build a database, it just goes straight to error with no progress bar:

![image](https://global.discourse-cdn.com/plex/original/4X/b/9/e/b9e1947234e67dc0a7f890cc84836fdea4414ab2.png)

For now, I am back down to the old 1.32 version but this is not sustainable. Is there anything I can do to upgrade? Thank you!

---

<div class="post-metadata">

**Author:** ![eddycj](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@eddycj](https://forums.plex.tv/u/eddycj)\
**Post date:** [September 22, 2024, 10:05am UTC](https://forums.plex.tv/t/upgrade-to-1-40-database-issues/889145/2 "2024-09-22T10:05:50Z")

</div>

Update - I tried following the Plex Support instructions to completely rebuild since I guess the corruption was fairly extreme: [Repair a Corrupted Database | Plex Support](https://support.plex.tv/articles/repair-a-corrupted-database/)

Microsoft Windows [Version 10.0.19045.4894]  
(c) Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32\>“C:\Program Files\Plex\Plex Media Server\Plex SQLite.exe” “%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db”  
SQLite version 3.39.4 2022-09-29 15:55:41  
Enter “.help” for usage hints.  
sqlite\> DELETE from external\_metadata\_items;  
sqlite\> .quit

C:\WINDOWS\system32\>“C:\Program Files\Plex\Plex Media Server\Plex SQLite.exe” “%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db”  
SQLite version 3.39.4 2022-09-29 15:55:41  
Enter “.help” for usage hints.  
sqlite\> PRAGMA integrity\_check;  
row 33039 missing from index index\_metadata\_items\_on\_guid  
database disk image is malformed  
sqlite\> vacuum;  
sqlite\> reindex;  
Runtime error: database disk image is malformed (11)  
sqlite\> .output db-recover.sqlite  
sqlite\> .recover  
sqlite\> .quit

C:\WINDOWS\system32\>“C:\Program Files\Plex\Plex Media Server\Plex SQLite.exe” “%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db”  
SQLite version 3.39.4 2022-09-29 15:55:41  
Enter “.help” for usage hints.  
sqlite\> .read db-recover.sqlite  
sqlite\>  
sqlite\>

And that has now worked with an upgrade to 1.41.0.8992. We can close this thread now - sorry for opening! But may be useful for someone else facing the same issues as me.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 21, 2024, 10:06am UTC](https://forums.plex.tv/t/upgrade-to-1-40-database-issues/889145/3 "2024-12-21T10:06:34Z")

</div>

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