This is an old revision of the document!


Sharing data directory between Zotero Standalone and Zotero for Firefox

When you install both Zotero Standalone and Zotero for Firefox, you will be asked if you want to share your data directory. The general recommendation is to respond “Yes”, because this will usually do what you expect Zotero to do. Here's some more detail on what's going on.

Why do I want to share the data directory

To understand why sharing the data directory is beneficial, you first need to understand how Zotero functions. When you add new items to your Zotero library, the metadata for those items is stored inside Zotero's database (zotero.sqlite) and file attachments are placed inside a special “storage” folder both of which are located inside your Zotero data directory. By default, the data directory is located inside the profile_directory. When you're using Firefox, this is the [https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data Firefox profile directory]; however, for Zotero Standalone, the profile directory is found in a different location. When Zotero for Firefox and Zotero Standalone are using distinct data directories, they are not “aware” of each other's presence and data between the two does not transfer as smoothly (or at all).

If Zotero Standalone and Zotero for Firefox share the same data directory, you will observe the following benefits: 1. Both save items to the same database, so when using either one individually, your data is always guaranteed to be in-sync. Furthermore, if you open Zotero for Firefox and Zotero Standalone at the same time, Zotero for Firefox will switch into a light-weight connector mode (very similar to Chrome/Opera/Safari connectors), where all the heavy lifting involving the database is performed inside Zotero Standalone. This may help speed up Firefox performance, but it also means that you _cannot_ open up Zotero for Firefox pane while Zotero Standalone is open (if you try, this will simply focus the Zotero Standalone window).

If the two were not sharing the same data directory, you would notice that adding an item to, say, Zotero for Firefox, does not immediately cause the item to appear in Zotero Standalone. If you have sync enabled in both Zotero Standalone and Zotero for Firefox, you will notice that the items do transfer eventually. This is because Zotero for Firefox ends up uploading the new item to zotero.org and Zotero Standalone, in turn, downloads it back onto your computer. As you can imagine, this is a slow process that results in useless utilization of your internet bandwidth.

2. In addition to “instant sync” between Zotero for Firefox and Zotero Standalone, sharing the data directory also ensures that your data is not needlessly duplicated on your computer. When directories are shared, both metadata and file attachments are stored in one central location. Without sharing the data directory, both Zotero for Firefox and Zotero Standalone would have to maintain individual copies of each. Depending on the size of your library, this could result in gigabytes of duplicated data, which may or may not be important to you.

3. Under rare circumstances, because the data is not instantaneously synced and you are able to edit your library in both Zotero for Firefox and Zotero Standalone, _not_ sharing the data directory could result in sync conflicts. Sharing the data directory would eliminate this possibility.

How do I share the data directory

This process should be almost automatic. When you install both Zotero for Firefox and Zotero Standalone, whichever you open up second would ask you if you wanted to share the data directory with the other. You simply have to click “Yes” and everything should be automatically configured. However, we have received reports where either the prompt never appeared or the data directories ended up being not shared for some other reason. In this case, you can follow the steps below to share the data directory between Zotero Standalone and Zotero for Firefox.

1. Determine which database you want to designate as the main database. Usually you can just pick either Zotero Standalone or Zotero for Firefox at random. If, however, the two databases are not the same (e.g. you did not have sync set up and you added a bunch of metadata to Zotero for Firefox, but it did not show up in Zotero Standalone), you should pick the more complete database.

If you have items in both that are not in the other (e.g. you added items to Zotero Standalone and to Zotero for Firefox, but they did not transfer between each other), you would first want to bring both databases to the same state to avoid loss of data. To accomplish this, simply set up sync and perform a complete sync on both applications (make sure that the sync completes without errors or you may end up losing some data!). Once the databases are in sync, you can pick one of them to be the main database (doesn't matter which).

2. Open up Preferences for the application that you chose to be the main database. Under Advanced → Files and Folders, click Show Data Directory. Note the path of the directory that is displayed.

3. Open the other application (either Zotero for Firefox or Zotero Standalone) and navigate to Preferences → Advanced → Files and Folders. In the “Data Directory Location” section, select Custom and choose the directory that you noted in step 2 (this should contain a zotero.sqlite file). The application will tell you that it needs to be restarted. Do so.

The data directories between Zotero Standalone and Zotero for Firefox should now be shared. See below for ways to confirm this.

How do I know if my data directories are shared?

The simplest way to confirm this is by opening both Zotero Stadalone and Firefox and then clicking the Zotero icon at the bottom right. If the data directories are shared, this should bring Zotero Standalone window into focus. Otherwise, Zotero will open up inside Firefox.

What are the disadvantages of sharing the data directory?

There really are no disadvantages to this, unless you desire some special setup for Zotero. For example, sometimes you may want to have two separate Zotero libraries. One way to accomplish this is to have separate data directories for Zotero Standalone and Zotero for Firefox. You can then use them as separate libraries with completely different sets of items. (An alternative to such an approach is using Firefox/Zotero Standalone profiles).

Is there anything special that I should be aware of when data directories are being shared?

While all your data is stored inside the data directory, your preferences are generally stored inside your profile directory. Sharing your data directory does _not_ share your profile directory, so preferences are not shared between Zotero for Firefox and Zotero Standalone. This means that if sometimes you use Zotero Standalone and sometimes you're using Zotero for Firefox on its own, you would want to set up things like sync for both of them separately (Preferences → Sync). Otherwise, you may notice that your data is not always synced to zotero.org. This applies to other preferences as well, but sync is probably the most important one.