Вы находитесь на странице: 1из 5

Backing Up Your Zotero Library

Elements of a Zotero Library - Data and Files

It is important to fully understand how Zotero stores its data, so you can
correctly back up your Zotero library and, when disaster strikes, recover it.
By default, your entire Zotero library is stored in the 'zotero' directory of your
Firefox profile. The most important file in this 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 Firefox 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 updates
to the Zotero extension).

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 can
damage 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 Mac OS X:

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

On Windows Vista and 7:

C:\Users\<User Name>\AppData\Roaming\Mozilla\Firefox\Profiles\<randomstring>\zotero

On Windows 2000 and XP:


C:\Documents and Settings\<username>\Application
Data\Mozilla\Firefox\Profiles\<randomstring>\zotero

On most Linux distributions:

~/.mozilla/firefox/<randomstring>/zotero

A search for 'zotero.sqlite' can also help you locate 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.

Backing Up Your Zotero Library

To back up your Zotero library, locate your Zotero library, close Firefox and
copy your 'zotero' data directory 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 — Syncing: Syncing is not a substitute for backing up. For


example, if you accidentally delete items in your library and sync your
Zotero library, you won't be able to recover these items from the Zotero
server.

Warning — Import/Export: Zotero allows you to 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
back up strategy.

For step-by-step, illustrated backup instructions, see this guide provided by


the Northwestern University library.

Restoring Your Zotero Library from a Backup

When you lose your original Zotero library (e.g. when the hard drive fails or
your computer is stolen), you can restore your library by replacing the
contents of your active 'zotero' data directory with that of your backed-up
'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 directory containing zotero.sqlite and
possibly a 'storage' subdirectory. 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 now reopen Firefox, your Zotero library should be restored.

Once you've successfully restored your data, you can delete the temporary
folder.

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.

1. First, make sure to keep Firefox running, as the automatic backup


might be overwritten when you quit Firefox. Then, locate your Zotero
library and make a copy of the zotero.sqlite.bak file and name it
zotero.sqlite.new.
2. Optionally, in Zotero, select any items you have added since you last
started Firefox (a saved search may be helpful), right-click the
selection, choose “Export Selected Items…”, and export to Zotero RDF.
3. 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 now see the backed-up version of your library.
4. If you exported any items, import the RDF file you created to restore
the data added during your last Firefox session.

If you're happy with the results, you can delete zotero.sqlite.old.

Restoring from the last upgrade backup

Zotero prompts you to upgrade your database when you install certain
(usually major) new versions. If you would like to revert to a previous version
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 server, reverting to a previous
version is as simple as reinstalling the previous version, closing Firefox,
replacing “zotero.sqlite” in your Zotero data directory with “zotero.sqlite.
[highest-number].bak”, and restarting Firefox. (Note that if you try to open
an upgraded database in an earlier version, Zotero will display an error. Just
close Firefox and replace the SQLite file.) Zotero will then sync from the
Zotero server 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
often cannot be used again with earlier versions.

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 Zotero
is looking in the wrong 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.

Вам также может понравиться