Database upgrade error

I have Zotero Standalone, and I've just upgraded my computer from Windows 7 to Windows 10, and I've encountered an error.

For many years, I've stored my Zotero data, including the SQLite database file, on Dropbox to sync it across multiple computers. I decided to do this based on a support post suggesting it (https://www.zotero.org/support/kb/using_multiple_computers) as an alternative to using the Zotero sync, which I didn't want to do as a student because I didn't want to pay for an additional service since I already pay for more Dropbox space than I could ever need. I am now reading on these forums that using Dropbox to sync can cause problems, although I've used it for years without any trouble.

However, now that I've upgraded to Windows 10, I've had a problem. I installed Zotero again, and I went to change the data directory to the folder with the data in it. A progress bar popped up saying it was upgrading my database, and then I got the following error:

Database upgrade error

Error: Error(s) encountered during statement execution: database disk image is malformed [QUERY: INSERT OR IGNORE INTO fulltextItemWords SELECT * FROM fulltextItemWordsOld] [PARAMS: ] [ERROR: database disk image is malformed]
Zotero.DBConnection.prototype.queryAsync<@chrome://zotero/content/xpcom/db.js:703:10
From previous event:
TaskImpl_handleResultValue@resource://gre/modules/Task.jsm:396:7
TaskImpl_run@resource://gre/modules/Task.jsm:327:15
TaskImpl@resource://gre/modules/Task.jsm:277:3
createAsyncFunction/asyncFunction@resource://gre/modules/Task.jsm:252:14
Task_spawn@resource://gre/modules/Task.jsm:166:12
ConnectionData.prototype<.executeTransaction/promise</transactionPromise<@resource://gre/modules/Sqlite.jsm:593:28
TaskImpl_run@resource://gre/modules/Task.jsm:319:42

___

The only options it gives are to look for updates (I tried that; there aren't any; this is the newest version), or Quit. If I choose Quit, Zotero exits, so I can't even change the directory back to the original one.

I've tried uninstalling and reinstalling the program, but it gives the same error, and I can never get into the program to change the directory again. I also restored the SQLite database to the one from yesterday that was working fine, just in case the SQLite file had indeed been damaged, but I get the same error.

I really love using Zotero, and I was very happy with the setup I had. I would greatly appreciate anyone who could help me with this problem.
  • I decided to do this based on a support post suggesting it (https://www.zotero.org/support/kb/using_multiple_computers) as an alternative to using the Zotero sync
    That article most definitely doesn't say to put your database in Dropbox, and we've always strongly cautioned against it, because it will, in fact, corrupt your database.

    At this point, your database is damaged, and there's a good chance it has been for a while, but you can try the DB Repair Tool.
  • Sorry, I should have clarified: that article says to store it on an "external drive", which at the time I understood (incorrectly, I now see), to mean some external syncing service, because it's presented in the context of an alternative to using the Zotero sync.

    Regardless, yesterday the database opened on all the computers I use without any problems, as it has for years, including the one that had Windows 10. It's only with this new installation of Zotero that the problem occurred. It certainly seems like it is related to the "database upgrade" procedure that took place with this new version of Zotero.

    Thank you for suggesting the repair tool. I will try that. If anyone has any other thoughts, I appreciate all suggestions.
  • edited May 3, 2018
    Yes, "external drive" in computing terms means a physical drive that you plug in.
    It certainly seems like it is related to the "database upgrade" procedure that took place with this new version of Zotero.
    The upgrade process simply accesses more of the database, which triggers the error. As I say, there's a good chance the database has been corrupted for a long time.
  • Just for the sake of anyone else with the same problem in the future, I wanted to report back.

    The DB Repair Tool worked (thanks for that suggestions, dstillman), although some data was missing (presumably the data that had been corrupted).

    However, because I could still open everything without any problems on my desktop, which was running Zotero 4 (the problem was clearly triggered by the changes to the database that took place when I upgraded to version 5, although I recognize the data was corrupt before that), I was able to export the library from the desktop and then import it into the new Zotero database. This created duplicates of most items, but those were easy to merge, so I didn't end up losing any data.

    I'm assuming that the exported version wouldn't be corrupt, so I'm hoping this is the fix tot he problem. I will obviously have to look for a new solution for syncing, but I hope that at least the database issue is taken care of.
  • A few things to note as you move forward:

    When you sync the newly populated library to your account, you will get duplicates for any items that exist in both places. You should merge those items (rather than deleting one of the two).

    Merged items will continue to work with documents that cited the original copy before the import. However, any items that hadn't been synced (and so have no duplicate) will not be recognized by your existing documents. You will need to reselect and reinsert those items in order for any edits to them in Zotero to be reflected in the documents.
  • Thanks for that heads up. I did make sure to merge duplicate entries, but I'll be on the lookout just in case.

    I also noticed that the original support article I referenced has been changed to explicitly address the point about Dropbox that I only discovered elsewhere too late, so hopefully no one will make the same mistake I did in the future.
Sign In or Register to comment.