This document helps answer the following questions:
- How does Zotero store my data?
- Where did my items go?
- Where is my Zotero data?
- How do I back up my Zotero library?
Before resolving these specific questions, it is crucial to understand some of the basics of how Zotero stores your data.
Zotero Data Fundamentals
What Makes a Zotero Library?
Before going into details on finding or recovering your library, it is crucial that you understand exactly what makes your library. Your entire Zotero library is stored, by default, in the 'zotero' directory of your Firefox profile. Inside that directory are two crucial elements: the zotero.sqlite file and the 'storage' folder. The zotero.sqlite file contains the majority of your data: item information, notes, tags, etc. The 'storage' folder contains all of your attachments: PDFs, web snapshots, audio files, and any other files you have imported.
Note that these data files are different from a Zotero RDF file (e.g., “Exported Items.rdf”) created via Zotero's export functions. While you can import data from an RDF file, restoring your data files directly is currently a much more accurate and reliable method.
Warning: Before you copy, delete or move any of these files, be sure that Firefox is closed. Failure to close Firefox before moving these files could result in damage to your data.
Locating your Zotero Library
The quickest and most reliable way to find your Zotero data directory is through the “Show Data Directory” button in the Advanced tab of your Zotero Preferences window.
By default, Zotero data is stored within your Firefox profile in these OS-dependent directories - on most systems you will have to select to “Show Hidden Files and Folders” to be able to navigate to the Firefox Profile.
On a Mac:
/Users/<username>/Library/Application Support/Firefox/Profiles/<randomstring>/zotero
On Windows 2000/XP:
C:\Documents and Settings\<username>\Application Data\Mozilla\Firefox\Profiles\<randomstring>\zotero
On Windows Vista:
C:\Users\<User Name>\AppData\Roaming\Mozilla\Firefox\Profiles\<randomstring>\zotero
On most Linux distributions:
~/.mozilla/firefox/<randomstring>/zotero
A search of your hard disk for zotero.sqlite will also help you to find the Zotero data directory.
If you have selected a custom data directory in the Advanced pane of the Zotero prefs, your data will be stored elsewhere. The “Show Data Directory” button will always reveal the data directory currently in use.
Troubleshooting Zotero Data issues
Where did my items go?
Occasionally after upgrades or system restores, users open Zotero to find their libraries almost completely blank. While you may find this a bit disconcerting if it happens to you, do not panic. In almost every case the fundamental issue is that Zotero is looking in a different location for your data. You need to make sure that Zotero is looking in the right location for your Zotero files and that the right files are in that spot. (A library can also appear empty due to an extension conflict, so be sure to check known incompatible extensions and disable your other Firefox extensions if you're sure that Zotero is looking in the right place.)
1. Make sure you are in the correct Firefox Profile.
Occasionally when upgrading, Firefox creates a new profile. (If you notice that your bookmarks and browser history have changed or disappeared, it's likely that this has occurred.) You can use the Firefox Profile manager to make sure that you are in fact in the correct profile.
2. Make sure your data files are in the directory where Zotero is looking.
Use the “Show Data Directory” button in the Advanced pane of your Zotero preferences to reveal the current data directory. If this isn't the directory you were expecting, you can either specify a different data directory in the Advanced pane of the Zotero prefs or, with Firefox closed, move any existing Zotero files (zotero.sqlite and 'storage') out of the way and copy your desired Zotero files into the displayed directory. If you're not sure where your data is located, it's a good idea to look for larger versions of zotero.sqlite or zotero.sqlite.bak stored elsewhere on your hard drive and to look in the 'storage' directory for recently saved PDFs and other files.
Unless you have a good reason to use a custom data directory location, we recommend using the default location within your Firefox profile.
When specifying a custom data directory location, keep in mind that Zotero doesn't move or copy any data. You still need to copy your data into the specified location. Also, when pointing the data directory location to an existing directory, be sure to specify the parent directory containing zotero.sqlite and 'storage', not the 'storage' directory itself.
Finally, remember to close Firefox before making any changes to Zotero files.
How do I back up my Zotero library?
To back up your Zotero library, close Firefox and copy your Zotero data directory to a backup location, preferably on another storage device.
You can locate the data directory by going to the Zotero preferences under Zotero's Actions (gear icon) menu and clicking “Show Data Directory” in the Advanced pane. If you can't open the Zotero pane, you can still access the Zotero preferences by going to the Firefox Tools menu → Add-ons → Extensions → Zotero → Preferences/Options.
The Zotero data directory holds both your database and all the related files and attachments (images, PDFs, webpages, etc.).
As with all important data, it is a good idea to back up your Zotero data frequently.
How do I restore my Zotero library from a backup?
If something drastic happens (hard drive melts, computer is stolen, etc.), you can simply copy the contents of your backed-up data directory into your active Zotero data directory.
First, reinstall Zotero from zotero.org if necessary. After restarting Firefox, open the Advanced pane of the Zotero preferences and click “Show data directory”. This should reveal a folder containing zotero.sqlite and possibly a 'storage' folder. Close Firefox and move zotero.sqlite and 'storage' from this folder into a temporary folder on your desktop. Next, copy zotero.sqlite and 'storage' from your backup into the active data directory. When you reopen Firefox, your Zotero library should be there waiting for you.
Once you've successfully restored your data, you can delete the folder on your desktop.
Recovering your library from the last automatic backup
Every time you close Firefox, and when your computer is idle, Zotero makes a backup copy within your data directory of your library if the last backup is more than 12 hours old. If you make a critical mistake while using Zotero—for example, if you accidentally delete a large set of items—you can revert to the last backup.
First, without closing Firefox, use “Show Data Directory” in the Advanced pane of the Zotero prefs to reveal your data directory and make a copy of the zotero.sqlite.bak file named zotero.sqlite.new. Then, in Zotero, select any items you have added since you last started Firefox (a saved search may be helpful), right-click those items and choose “Export Selected Items…”, and export to Zotero RDF. Close Firefox. In your data directory, rename zotero.sqlite to zotero.sqlite.old, rename zotero.sqlite.new to zotero.sqlite, and restart Firefox. You should see the previous version of your data. Finally, import the RDF file you created to restore the data added since the previous startup.