Manual Zotero Database Repair Instructions

Advanced (or adventurous) users can repair their databases without uploading them.

If you’ve been using Zotero syncing and your data is all online, you should not follow these steps. Simply close Zotero, delete zotero.sqlite in your Zotero data directory, reopen Zotero, and let it sync to rebuild your database from the online library.

If you have no other choice, these steps may help you repair your database. Be sure to make a backup of your entire Zotero data directory before continuing.

macOS

  1. Open Terminal in /Applications/Utilities.
  2. Type "cd" (without quotes) followed by a space, and then drag the 'zotero' folder from your Zotero data directory into the Terminal window to copy its path. Press Return.

Then type the following commands in Terminal:

  1. sqlite3 zotero.sqlite .recover > dump.sql
  2. mv zotero.sqlite zotero.sqlite.old
  3. sqlite3 zotero.sqlite < dump.sql

Your Zotero database should no longer be corrupted, though it may be missing data or otherwise in an invalid state. If things seem to be working properly, you can delete the zotero.sqlite.old file.

Post to the Zotero Forums with any problems.

Windows and Linux

Same as the macOS instructions, with appropriate modifications.