Syncing Zotero with Dropbox and Between Several Computers

Zotero-Dropbox-Sync-Remember-Everything-OrgIn this post I want to shed some light on how you can sync your Zotero library between different computers, and between your computer and Dropbox, a popular cloud storage service. Due to the nature of the matter, what follows is somewhat technical, but don’t let that deter you. Once setup, the synchronization works automatically in the background, without any further effort.

In a previous post, I introduced Zotero, a popular free research tool by the Roy Rosenberg Center for History and New Media of George Mason University. As a brief recap: Zotero allows you to organize all your research sources and create a complete digital library with the click of a few buttons. To learn more about this fantastic tool and why every knowledge worker should consider using it, please check this post.

Recommended approach for syncing Zotero between different computers.

Zotero allows you to synchronize everything via its own cloud storage service, Zotero Storage. “Everything” includes:

  1. the Zotero data (i.e., the database with all bibliographic information, tags, and notes)
  2. the Zotero files (i.e. attachments, such as PDF documents, videos, books, and webpage snapshots)

The basic plan (upto 300 MB) is free. 2GB will cost you $1.67 per month ($20 per year), and 6 GB set you back $5 per month ($60 per year). IMO, Zotero Storage should be your first consideration as it is very easy to setup and manage, it is affordable, and your payments support the up-keeping of the infrastructure.

There are, however, some good reasons why you might want to employ a different method to sync your Zotero files:

  1. You have a very large number of attachments or some very large attachments.
  2. You have already subscribed to a service like the popular Dropbox, and would rather avoid paying for an additional cloud storage service.
  3. You have a very slow or expensive internet connection, but have your computers connected via a local area network.
  4. You are looking for a solution to create a local backup for your files (and database).

(The database is usually below the free storage limit and should always be synchronized via Zotero’s cloud service.)

Here then are some alternative solutions you can employ:

  1. Sync the Zotero data via Zotero’s cloud service and the files via a storage service that supports the so-called Webdav protocol. This is the second method that is officially supported by Zotero.
  2. Sync the data via Zotero’s cloud service and the files via Dropbox. Unfortunately, Dropbox doesn’t support Webdav, but there is a different way…
  3. Sync the data via Zotero’s cloud service and the files via a local network (wireless or wired).
  4. Backup Zotero to a second hard disk or computer.

Many people are looking for a solution to synchronize Zotero via Dropbox, so in this post, we will take a look at this solution. In future articles, we are going to look at some of the other scenarios.

Controlling how Zotero syncs its database and files

  1. Open Zotero, and select Preferences:Zotero-Dropbox-Sync-Preferences
  2. Select Sync to control the synchronization
    1. Type in your account details, and tick Sync automatically to have your database synchronized with Zotero’s cloud service. If you don’t yet have an account, use the supplied link to create one.
    2. Disable Sync attachment files in My Library to use a service like Dropsync to synchronize your files.Zotero-Dropbox-Sync-Synctab

Where is Zotero’s data stored?

Click on Advanced, select the tab Files and Folders. Click on Show Data Directory.Zotero-Dropbox-Sync-Advanced

This opens the data folder. In my case the path is F:\Appsdata\zotero:Zotero-Dropbox-Sync-Datafolder

Note the path to your Zotero data folder as we will need this later in the setup.

Zotero files (i.e., all attachments) are stored in the subfolder storage, which is exactly the folder we have to synchronize via Dropbox.

PRECAUTION: If you are not yet making regular backups of your data, I strongly suggest that you now close your web browser and backup the Zotero data folder, including all subfolders to a safe location, such as an external harddisk.

Update, July 22, 2013:

Aurimas on July 22, 2013 at 9:59 am said:   “Symlinks are a bit quirky with DropBox (in my experience on Windows. And this may have since been fixed). DropBox (or Google Drive for that matter) does not really continually scan content inside symlinked folders unlike content in regular folders. So any changes you make to the files do not get updated until the next time you start DropBox…”

I have tested Aurimas’ comment – and indeed, in Windows 7 the synchronization does not happen right away, but rather after a restart of Dropbox or pausing/resuming the synchronization. While this works, it requires an additional step by the user. To keep the sync fully automatic and immediate, I have decided to adjust the procedure below as suggested by Aurimas in his comment. In case you don’t have enough space on the hard disk where Dropbox is located (like myself), or don’t want to move the Zotero storage folder, you can find the original procedure for the first PC here. Just be aware that you then might have to manually trigger the sync by pausing and restarting it. The procedure for PC 2 etc., as described below, does not change.

Unfortunately, Zotero doesn’t allow us to move the folder storage to our Dropbox folder (independently of the data folder). We could, in principle, move the complete data folder to Dropbox, but this should be avoided as Zotero and Dropbox, or multiple computers accessing Zotero via their Dropbox folder might get in each other’s way and corrupt the database.

Help is at hand though: Windows, Mac-OS, and Linux provide so-called symbolic links, an ingenious mechanism that allows us to make a folder visible in a second folder.

What is a symbolic link?

To a program, a symbolic link looks like a normal folder/file.  In reality, however, it is a file that contains the path to a destination folder/file. Programs that access the symbolic link are automatically redirected to the destination folder. In our case, by moving our Zotero storage folder to Dropbox, and then placing a symbolic link in our Zotero folder (redirecting to the storage folder in Dropbox), we can make this folder visible to Zotero, yet at the same time allow Dropbox to automatically include this folder and synchronize the contents with its cloud storage.

Moving your Zotero storage folder to Dropbox and replacing it by a symbolic link.

Below, I show how to create the necessary symbolic links in Windows 7/Vista.

  1. Find out the location of the Zotero storage folder as described above.
  2. Open your Dropbox folder by clicking on the Dropbox icon and Dropbox folder.Zotero-Dropbox-Sync-Dropbox-start Zotero-Dropbox-Sync-Dropbox-openfolderZotero-Dropbox-Sync-Dropboxfolder
  3. Note the location of your Dropbox folder as well. In my case, this path is j:\Dropbox
  4. Check that you have enough space on the hard disk/partition where Dropbox is located to hold the content of the storage folder.
  5. Close Zotero to prevent it from accessing its data folder. If you are running Zotero in Firefox, close Firefox to achieve this.
  6. Move the storage folder from Zotero’s data folder to your Dropbox folder.
  7. Start the Windows command interpreter CMD in Administrator mode:
    1. Type cmd.exe in the Windows Start Menu.
    2. Right-click cmd and select Run as administrator.Zotero-Dropbox-Sync-Open-CMD
      As a recap, here are the important folders
      My Zotero data folder is F:\Appsdata\Zotero
      My Dropbox folder is J:\Dropbox
  8. In CMD, type mklink Your-Zotero-folder\Storage Your-Dropbox-folder\Storage  /d
    In my case: mlink F:\Appsdata\zotero\storage J:\Dropbox\storage /dZotero-Dropbox-Sync-CMD-mklink1a

This creates a symbolic link named storage in your Zotero folder. The symbolic link redirects to the folder storage in your Dropbox folder:

If you have an active Internet connection, Dropbox will have already started to upload files from your storage folder. Depending on the speed of your Internet connection and the size of your storage folder, this might take a while.

What have we achieved so far?

  • Dropbox automatically backups up all changes to the storage folder to its cloud storage.
  • Zotero sees the symbolic link storage which redirects to the storage folder in Dropbox.
  • The database is backed up via Zotero’s cloud storage.

How to include a second computer (and further computers) in this scenario?

  1. For each computer you want to include, install Zotero.
  2. As described before, configure Zotero to synchronize its database via the Zotero cloud service, and disable file synchronization.
  3. Install Dropbox (if not yet done), and allow for the Dropbox folder to be downloaded. This will include the Zotero storage folder (uploaded from our first computer), including all files contained.

On the second PC (and further PCs) we also have to create a symbolic link named storage in the Zotero data folder that redirects to the folder storage in Dropbox. If the folder storage already exists in your Zotero folder (on the second PC), you have to delete this folder. Since we assume here that you have performed a fresh Zotero installation, this folder should still be empty.

  1. Note the location of your Zotero folder and your Dropbox folder on the second PC (as described above for the first PC)
  2. If the folder storage exists in your Zotero folder, make sure that it is empty. Instead of moving it, you have to delete it to create a symbolic link. Close Zotero before you delete this folder.
  3. Start cmd.exe in Administrator mode (as described earlier) and create a symbolic link as follows:
    Type mklink Your-Zotero-folder\Storage Your-Dropbox-folder\Storage /d
    This creates a symbolic link named storage from your Zotero folder redirecting to the folder storage in your Dropbox.Zotero-Dropbox-Sync-CMD-mklinkPC2-1
  4. Double-click the link storage in your Zotero folder to check if it works:Zotero-Dropbox-Sync-Datafolder-PC2

That’s all there is to synchronizing your Zotero files between different computers via Dropbox. To include further computers, just follow the template for the second PC, outlined above.

I hope this post provides a useful solution to you, my valued reader. Please don’t hesitate to leave a feedback. Have a great day!

Helmut Sachs

14 thoughts on “Syncing Zotero with Dropbox and Between Several Computers

  1. Symlinks are a bit quirky with DropBox (in my experience on Windows. And this may have since been fixed). DropBox (or Google Drive for that matter) does not really continually scan content inside symlinked folders unlike content in regular folders. So any changes you make to the files do not get updated until the next time you start DropBox (usually after a restart) and it performs a complete scan of the sync directory (it does follow symlinks then).

    What I had done in the past to avoid this annoying behavior is move the “storage” folder from Zotero’s data directory to DropBox (close Zotero and Dropbox first) and then create a symlink inside the Zotero’s data directory to point to DropBox. Zotero doesn’t care if the storage directory is a symlink, so it keeps both programs happy.

    Not to advertise for other services, but if you’re not too committed to DropBox, there are plenty of cloud-based sync services that allow you to sync specific folders on your computer without having to move them into the main “sync folder”. This would eliminate the need for creating symlinks. E.g. SpiderOak or SugarSync

  2. Hi Aurimas,
    thanks a lot for stopping by and your suggestion to move the Zotero storage folder to Dropbox, and create a symbolic link from the Zotero data folder.
    This is, in fact, done in the scheme above for all PCs except the first one.
    Doing it on the first PC as well, as suggested by you, is IMO, a good idea. Thanks for pointing out that quirky behavior. I haven’t noticed it yet, but will give it a good test.

    Update: Indeed, in Windows 7, uodates in linked directories are not immediately synchronized by Dropbox. Pausing the sync and then resuming it causes Dropbox to sync the changes. To avoid this hassle, I have adapted the procedure for the first PC, as outlined by you. Thanks a lot for bringing this to my attention.

    The main disadvantages of moving the Zotero storage folder are:
    1. Slightly more dangerous setup because you have to move potentially gigabytes of data to a different folder, which in my case is even on a different partition…
    2. If you have two different partitions, with Zotero storage on one and Dropbox on the other, you might not have the space to move it.

    Using a cloud service other than Dropbox is also a good idea, preferably one that supports Webdav (which is directly supported by Zotero).

    However, Dropbox is very popular, and people who are already paying for it might not want to subscribe to a second service.

    Personally, I would recommend subscribing to Zotero’s own cloud service as described above. That way you are supporting Zotero and enjoying their full support (e.g., also for group libraries).

  3. Amazing!! It works perfectly and I greatly appreciated the very detailed procedure as well as the explanations. Many many thanks!

  4. Hello Emmanuelle,
    thank you very much for stopping by and your feedback. Have a wonderful day!

  5. Thank you very much for these very clear instructions!

    I have a somewhat different scenario that I wanted to ask you about. Since I’m a chemist, and I’m not a native English speaker, I apologize in advance if I won’t be able to describe the issue properly.

    I need to share my Zotero library between my host computer (linux os) and a virtual machine (VM; VirtualBox, Win7 os).

    In principle, your instructions are perfectly compatible with this. However, I was wandering if I could avoid to use VM space to host the ‘storage’ directory in VM’s Dropbox, which is actually a duplicate of a directory already present on the host computer.

    I was thinking that I could share the ‘storage’ directory in Dropbox@host with the virtual machine, and then create a symbolic link to it in the Zotero directory @VM.

    What do you think of this?
    Thanks for your advice!

  6. Hi Giovanna,

    I have not tested the scenario you want to implement and unfortunately currently don’t have the environment to test it! Thai being said, if you only create a symbolic link to the Zotero storage folder from the Zotero data folder in the guest OS (e.g. Win7), I would imagine you should be alright from the Zotero side. The host and the guest OS would each need its own Zotero data folder (synced via Zotero’s cloud service). Sharing the complete Zotero data folder between host and guest via a file share would very likely lead to a corrupt database in the long run, so this should be avoided.
    If I was going to implement your scenario, I would only run the Dropbox client on the Linux host OS and let that client detect and synchronize all the changes in the Dropbox folder (incl. the ones occurring from the Win7 side).
    As mentioned before, I have not tested this!
    Thank you for stopping by. I’d be happy if you could share how it went.
    Have a wonderful day!

  7. This is a probably much simpler issue. At present I use OneNote’s ‘Link’ function to hyperlink to pdf folders stored in Windows Explorer and replicated in the remote DropBox. I simply link to the appropriate DropBox url.

    I want to transfer all my DropBox pdfs to Zotero, but want to be sure I have some way of linking my OneNote comments to these Zotero pdfs.

    How to do it?

  8. Hi Matthew,

    You can, for example, link from Zotero to OneNote notes (and notes in other applications) by attaching a Note to the PDF entry in Zotero and pasting the OneNote links into that note. See paragraph “Saving notes in OneNote and linking them with Zotero” in my post remembereverything.org/managing-kindle-highlights-zotero-evernote-onenote/ .
    Please note that links in Zotero notes are now click-able, so you no longer have to use the report function mentioned in the post.

    All the best.

  9. This is awesome! Thanks! I implemented this with Google Drive on a Mac and it works great. PDFs open as they should from Zotero and they save to the Google Drive storage folder when acquiring new Zotero entries with PDFs from the web.

    Here’s the OS X terminal command to create the symlink:
    ln -s /path/to/original /path/to/symlink.

  10. Will this allow files to sync between windows and os-x? If yes, what is the mac equivalent to create the symlink in the terminal?

    I have been using dropbox to save pdfs, then adding a file link to the .pdf in Zotero, but the link seems to get broken when I switch form my PC (work) to my Mac (home).

    This post seems like a good alternative.

  11. Hi Wazel,

    I currently don’t have a Mac at hand, but I don’t see why it shouldn’t work. Here is an article on how to create a symbolic link on Mac OSX: apple.stackexchange.com/questions/115646/how-can-i-create-a-symbolic-link-in-terminal

    All the best.

  12. This blog is a great contribution to us zotero users. Thanks! One small comment I had was about your statement that “Using a cloud service other than Dropbox is also a good idea, preferably one that supports Webdav (which is directly supported by Zotero).”. This is true, but only for personal libraries (“My Library”). The webdav option is not available for group libraries.

Leave a Reply