Database upgrade error: "unable to open database file"
dstillman
Zotero Team
This discussion was created from comments split from: Zotero shows database upgrade error.
Upgrade Storage
Database upgrade error
Error: Error(s) encountered during statement execution: unable to open database file
[QUERY: DELETE FROM itemTypesCombined] [PARAMS: ] [ERROR: unable to open database file]
Zotero.DBConnection.prototype.queryAsync<@chrome://zotero/content/xpcom/db.js:669:13
From previous event:
_updateCustomTables@chrome://zotero/content/xpcom/schema.js:851:11
Zotero.Schema</this.updateSchema/updated<@chrome://zotero/content/xpcom/schema.js:198:17
I clicked "check for upgrade" but Zotero didn't find one.
I then made a backup copy of my Zotero directory (which is on my local HD) and renamed the Zotero directory so that Zotero would open. I pointed Zotero at the renamed directory, same error message (no surprise but thought I'd try that).
I used the repair tool on (https://www.zotero.org/utils/dbfix/) on zotero.sqlite. Same error message.
Reinstalled Zotero. Same error message.
Prior to this, the last time I used Zotero successfully was maybe a month ago.
I upgraded from Windows 10 to Windows 11 yesterday... which (you'd hope!) wouldn't matter....!
Nothing else comes to mind right now in terms of any other hardware or software changes.
Thanks in advance for any and all assistance!
I checked the file properties (Windows Explorer, Properties/Security) of the Workflow and ZoteroData folders, zotero.sqlite, zotero.sqlite.bak, and zotero.sqlite.1.bak.
The permissions for my user account are identical to the permissions of SYSTEM and administrators (ie everything is checked).
When I click on Advanced/Effective Access and select object name Administrator and View effective access, every item is checked in green. When I select object name Users, every item is crossed in red.
Is any of that helpful?
Q: How many Microsoft software engineers does it take to change a lightbulb?
A: None, they just redefine the industry standard as darkness :)
In case my solution is of use to someone else [but see my next comment for a much better solution] is:
1. I renamed my existing Zotero data folder, so that Zotero would open without the "unable to open database file".
2. I copied my existing Zotero data folder from its custom location C:\\Users\SLB\Documents\Workflow\ZoteroData) to C:\\Users\SLB\
3. I launched Zotero.
4. In Zotero, I changed the data directory location from the default C:\\Uses\SLB\Zotero to C:\\Users\SLB\ZoteroData
[Edit/Preferences/Files and Folders/Data directory location]
5. My library appeared.
Notes:
Before following the procedure listed above, I tried copying all my Zotero files and subfolders from my "old" custom directory to the new default directory. But that didn't help - Zotero still produced the error message "unable to open database file".
As mentioned earlier, I upgraded to Windows 11 recently.
Since this upgrade, I have encountered (so far) three application programs (Zotero, Quicken, and Dropbox) that didn't work properly (in various ways) with existing custom data folder locations; but worked fine after I had switched back to the application's default data folder location (a subfolder of C:\\Users\SLB\ in all three cases).
Windows does throw a "controlled folder access blocked" notification when this happens, however, if Focus Assist is turned on (which it was after my Windows 11 upgrade either by default or inherited from from my Win10 settings), they are silently posted to the Notification Centre. (Which I eventually looked at.)