Table of Contents

The Zotero Data Directory

Locating Your Zotero Data

The easiest and most reliable way to find your Zotero data is by clicking the “Show Data Directory” button in the Advanced tab of your Zotero Preferences window. This will reveal the folder on your computer that contains your Zotero database and attachment files.

Default Locations

Zotero 5.0

Unless you have selected a custom data directory in the Advanced pane of the Zotero preferences, your Zotero data is stored within the following OS-dependent directories:

macOS
/Users/<username>/Zotero
Windows 7 and higher
C:\Users\<User Name>\Zotero
Windows XP/2000
C:\Documents and Settings\<username>\Zotero
Linux
~/Zotero

Zotero 4.0 for Firefox

macOS
/Users/<username>/Library/Application Support/Firefox/Profiles/<randomstring>/zotero

Note: The /Users/<username>/Library folder is hidden by default. To access it, click on your desktop, hold down the Option key, and click the Finder's Go menu, and then select Library from the menu.

Windows 7 and higher
C:\Users\<User Name>\AppData\Roaming\Mozilla\Firefox\Profiles\<randomstring>\zotero
Windows XP/2000
C:\Documents and Settings\<username>\Application Data\Mozilla\Firefox\Profiles\<randomstring>\zotero
Linux (most distributions)
~/.mozilla/firefox/Profiles/<randomstring>/zotero

Zotero 4.0 Standalone

macOS
/Users/<username>/Library/Application Support/Zotero/Profiles/<randomstring>/zotero

Note: The /Users/<username>/Library folder is hidden by default. To access it, click on your desktop, hold down the Option key, and click the Finder's Go menu, and then select Library from the menu.

Windows 7 and higher
C:\Users\<User Name>\AppData\Roaming\Zotero\Zotero\Profiles\<randomstring>\zotero
Windows XP/2000
C:\Documents and Settings\<username>\Application Data\Zotero\Profiles\<randomstring>\zotero
Linux (most distributions)
~/.zotero/Profiles/<randomstring>/zotero

The “Show Data Directory” button will always reveal the data directory currently in use and is the recommended method for finding your data directory. If you're unable to access the Zotero preferences, a search for the file name 'zotero.sqlite' can also help you locate the Zotero data directory.

Library Contents

The most important file in the data directory is the zotero.sqlite file, which contains the majority of your data: item metadata, notes, tags, etc. The directory also contains a 'storage' subdirectory, containing all of your file attachments, such as PDFs, web snapshots, audio files, or any other files you have imported (note that files that are linked are not copied into this subdirectory).

Your 'zotero' directory will likely contain several other files. These can include zotero.sqlite.bak (an automatic backup of zotero.sqlite, which is updated when you quit Zotero and the existing zotero.sqlite.bak file hasn't been updated in the last 12 hours) and zotero.sqlite.[number].bak files (automatic backups of zotero.sqlite that are created during certain Zotero updates).

Warning: Before you copy, delete, or move any of these files, be sure that Zotero is closed. Failure to do so before moving these files can damage your data.

Backing Up Your Zotero Library

We strongly recommend that you regularly back up your Zotero library. Syncing is not a good substitute for backing up: the Zotero servers only store the most recent version of your library, and it takes just a single (possibly automatic) sync to change the server copy.

Rather than backing up just your Zotero library, we recommend using a backup utility that automatically backs up your entire hard drive to an external device on a regular basis. Most modern operating systems offer such functionality (e.g., Time Machine on Macs).

If you want to back up your Zotero data specifically, locate your Zotero data, close Zotero, and copy your data directory (the entire directory, including storage and the other subdirectories) to a backup location, preferably on another storage device. As with all important data, it is a good idea to back up your Zotero data frequently.

Warning: Zotero lets you export your Zotero library as a Zotero RDF file. However, exporting and importing your library via RDF won't result in an exact copy of your library, and it isn't recommended as a backup strategy.

For step-by-step, illustrated backup instructions, see this guide provided by the Northwestern University library.

Restoring Your Zotero Library from a Backup

Between manual backups, automatic backups, and synced data, it's often possible to restore a lost Zotero library or restore data that was accidentally deleted.

Before following these steps, be sure that Zotero is looking in the right place for your data.

Restoring your Zotero library using Zotero syncing

If you were using Zotero syncing and have an empty local library, you can likely restore your data simply by syncing with your online library. After verifying that your library is correct on zotero.org, simply reenter your username and password in the Sync pane of the Zotero preferences and click the Sync button in the toolbar. (Zotero only syncs explicit deletions, so just syncing an empty library won't overwrite the server data unless you deleted items manually.)

If you have a local Zotero library that you want to overwrite, close Zotero and delete the old Zotero data directory before syncing. Syncing your database with a different Zotero account will also prompt you to remove the existing local database.

Restoring your Zotero library from a backup

If you were not using Zotero syncing (or were but don't want to perform a full sync) and have a backup of your Zotero data directory, you can restore your library by replacing your active data directory with your backed-up data directory.

Open the Advanced pane of the Zotero preferences and make a note of the specified path under Data Directory Location. (By default, this will be “Zotero” within your home directory.) Click “Show Data Directory”, which should reveal your active data directory containing zotero.sqlite and possibly a 'storage' subdirectory. Close Zotero, move one level up in the filesystem (Cmd-up-arrow on macOS, Alt-up-arrow on Windows), and rename the directory to “Zotero-Old”. Next, copy the data directory from your backup to the original location (e.g., “Zotero”).

When you reopen Zotero, you should see your restored Zotero data.

Once you've successfully restored your data, you can delete the “Zotero-Old” folder, but it's a good idea to keep it for a while until you're sure your data is correct.

Note that, if you were using Zotero syncing, any changes you made to your library since the backup and subsequently synced to your online library will be applied to your restored database as soon as you sync. If you don't want that to happen, see the following section.

Restoring your Zotero library from a backup and overwriting synced changes

If you or someone else made unwanted changes to your Zotero library and synced those changes to your online library, you may be able to restore data by using a local backup of your Zotero data directory.

  1. Temporarily disable auto-sync in the Sync pane of the Zotero preferences.
  2. Follow the steps in the preceding section to restore from a backup of your Zotero data directory.
  3. Once you see your restored data, were you to sync again, the more recent data in the online library would replace the data you just restored.
    1. If you're trying to restore a small number of deleted items or notes, you can simply duplicate the items — by right-clicking and choosing “Duplicate Item(s)” — so that the new copies remain even after syncing.
    2. If many items were affected or collections were deleted, you can use Restore to Online Library to force Zotero to upload the local version of the library, overwriting previously synced changes.

If you're happy with the results, you can re-enable auto-sync and continue working.

Restoring from the last automatic backup

If you make a critical mistake while using Zotero — for example, if you accidentally delete a large set of items — you may be able to revert to the last automatic backup.

If you're using syncing but don't have auto-sync enabled, first check your online library on zotero.org to see if the data is correct there. If so, close Zotero, go to your Zotero data directory, and rename it (e.g., to “Zotero-old”). Then, re-open Zotero and sync from the Zotero servers to the new empty local library.

If you don't want to do a full sync or if the changes have already synced to the online library, follow these steps to restore from an automatic backup. Note that automatic backups contain only data, not files.

  1. First, make sure to keep Zotero running, as the automatic backup might be overwritten when you quit the application.
  2. If you're using syncing, temporarily disable auto-sync in the Sync pane of the Zotero preferences.
  3. Locate your Zotero data and make a copy of any zotero.sqlite.bak files. The timestamps of the files may help you determine which file would contain the data you're trying to restore.
  4. Close Zotero. In your data directory, rename zotero.sqlite to zotero.sqlite.old, rename one of the .bak copies you made to zotero.sqlite, and restart Zotero. You should now see the backed-up version of your library.
  5. Were you to sync again now, the more recent data in the online library would replace the data you just restored.
    1. If you're trying to restore a small number of deleted items or notes, you can simply duplicate the items — by right-clicking and choosing “Duplicate Item(s)” — so that the new copies remain even after syncing.
    2. If many items were affected or collections were deleted, you can use Restore to Online Library to force Zotero to upload the local version of the library, overwriting previously synced changes.

If you're happy with the results, you can re-enable auto-sync and continue working. Keep zotero.sqlite.old until you're sure all your data is intact and in sync across all your computers.

Restoring from the last upgrade backup

When you upgrade to a major new version of Zotero, Zotero will automatically update your database to work with the new version. If you would like to revert to a previous version of Zotero at a later point, you will have to manually replace your database with the automatic backup Zotero made during the upgrade. In most cases this will be the highest-numbered “zotero.sqlite.[num].bak” file in your Zotero data directory.

It's a good idea to make a backup of your entire Zotero data directory before making any changes.

If you have synced your data with the Zotero servers, reverting to a previous version is as simple as reinstalling the previous version, closing Zotero, replacing “zotero.sqlite” in your Zotero data directory with “zotero.sqlite.[highest-number].bak”, and restarting Zotero. (Note that if you try to open an upgraded database in an earlier version, Zotero will display an error. Just close Zotero and replace the .sqlite file.) Zotero will then sync from the online library any changes made since you last used the older database.

If you were not using syncing, you may wish to export to Zotero RDF any items added since the database upgrade and then reimport those into the earlier version. Sorting your library by Date Added may help you find such items.

Bear in mind that word processor documents used with later Zotero versions may not be usable with earlier versions, and Zotero developers and community members will provide only limited support for earlier versions (mostly to recommend upgrading to the current version).

Troubleshooting Zotero Data issues

Where did my items go?

If you open Zotero to find your library blank or missing lots of data, don't panic. Zotero is mostly likely simply looking in the wrong location for the 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.

Use the “Show Data Directory” button in the Advanced pane of the 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 from the preferences or, with Zotero closed, rename that directory (e.g., to “Zotero-Old”) and move your desired Zotero directory to the specified location. If you're not sure where your most recent Zotero 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 at the dates of folders within the 'storage' directory.

If you have recently updated to Zotero 5 and are missing data, see Missing Data After Zotero 5 Upgrade.

Unless you have a good reason to use a custom data directory location, we recommend using the default location in your home directory.

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 Zotero before making any changes to Zotero files.