Another source of the "corrupt database" issue can happen when upgrading from a very old version of Firefox. None of the database maintenance suggestions in other answers will help in this case.
I recently gave in and decided to upgrade my long-standing version 56 Firefox to version 90 (last version where Proton can be disabled). When my existing profile was opened with version 90, it always renamed my existing SQLite databases as .corrupt
. I found this question while looking for an explanation, and I found the answer in Database.cpp
:
// Firefox 60 uses schema version 43.
if (currentSchemaVersion < 43) {
// These are versions older than Firefox 60 ESR that are not supported
// anymore. In this case it's safer to just replace the database.
return NS_ERROR_FILE_CORRUPTED;
}
This means that any profiles older than Firefox 60 will never be usable in newer versions of Firefox and will always be marked as corrupt.
The easiest way to deal with this and keep your existing profile when upgrading to the current version of Firefox is to use an earlier release as a stepping stone. It will upgrade your databases to a newer version which is supported by the current Firefox.
To do it I used the following steps:
Get the backup you should have of your Firefox profile from before you installed the current version. If you don't have one, you can try making a copy of your existing one, renaming the .corrupt
databases back to their normal names.
Download and extract an older version of Firefox that will support your profile version. I used the previous ESR, version 68.0.9. That's the 64-bit version but other platforms and languages are available. The exe
setup file can be extracted using 7zip.
The extracted folder will have a core
folder containing the Firefox application files. Put the copy of your profile (the folder named like abcd1234.default
) in this folder.
To disable Firefox updates so they doesn't cause problems, create a folder named distribution
inside core
, then create a text file named policies.json
inside that. Put the following into the JSON file and save it:
{ "policies": { "DisableAppUpdate": true } }
Open a command prompt in core
and run: firefox.exe -no-remote -profile YOUR_PROFILE_NAME
. This will run a standalone version of Firefox using your profile, which will upgrade the databases.
Once the browser is open, verify your profile looks correct. Browser history and favicons shown in bookmarks are two good indicators. Close Firefox and check the profile folder that none of the databases were renamed .corrupt
. (You can rerun the command as many times as you want to verify and test things.)
Copy the profile folder you just updated back into your normal Firefox profiles folder (on Windows, %AppData%\Mozilla\Firefox\Profiles
). I'd suggest renaming the existing folder you have in that location to keep a backup.
Install the current version of Firefox again. This time it should be able to upgrade your profile since the databases have been brought up to a supported version.
As an aside, this same method is a great way to test new Firefox versions. I used this method occasionally over the last few years to see if the addons I use had WebExtension versions available, and to see how hard it would be to update from version 56 to the newest. Just be very careful to never run firefox.exe
without using -no-remote
or it will find your normal existing profile and update it (always make a backup beforehand!)