Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
zotero_data [2022/06/24 03:34] – [Locating Missing Zotero Data] dstillmanzotero_data [2023/07/13 17:52] (current) – [Backing Up Your Zotero Data] dstillman
Line 3: Line 3:
 ===== Locating Your Zotero Data ===== ===== 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 [[preferences/advanced|Advanced]] tab of your Zotero [[preferences|Preferences]] window. This will reveal the folder on your computer that contains your Zotero database and attachment files.+The easiest and most reliable way to find your Zotero data is by clicking the "Show Data Directory" button in the [[preferences/advanced|Advanced]] tab of the [[preferences|Zotero preferences]]. This will reveal the folder on your computer that contains your Zotero database and attachment files.
  
 ==== Default Locations ==== ==== Default Locations ====
- 
-=== Zotero 5 === 
  
 Unless you have selected a custom data directory in the [[preferences/advanced|Advanced]] pane of the Zotero preferences, your Zotero data is stored within the following OS-dependent directories: Unless you have selected a custom data directory in the [[preferences/advanced|Advanced]] pane of the Zotero preferences, your Zotero data is stored within the following OS-dependent directories:
Line 16: Line 14:
 |**Linux**|<code>~/Zotero</code>| |**Linux**|<code>~/Zotero</code>|
  
-=== Zotero 4 for Firefox (2017 and earlier) ===+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. 
 + 
 +<details> 
 +<summary>**Older Versions**</summary> 
 + 
 +<html><h5>Zotero 4 for Firefox (2017 and earlier)</h5></html>
  
 |**macOS**|<code>/Users/<username>/Library/Application Support/Firefox/Profiles/<randomstring>/zotero</code> <html><small>Note: The /Users/&lt;username&gt;/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.</small></html>| |**macOS**|<code>/Users/<username>/Library/Application Support/Firefox/Profiles/<randomstring>/zotero</code> <html><small>Note: The /Users/&lt;username&gt;/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.</small></html>|
Line 23: Line 26:
 |**Linux (most distributions)**|<code>~/.mozilla/firefox/Profiles/<randomstring>/zotero</code>| |**Linux (most distributions)**|<code>~/.mozilla/firefox/Profiles/<randomstring>/zotero</code>|
  
-=== Zotero 4 Standalone (2017 and earlier) ===+<html><h5>Zotero 4 Standalone (2017 and earlier)</h5></html>
  
 |**macOS**|<code>/Users/<username>/Library/Application Support/Zotero/Profiles/<randomstring>/zotero</code> <html><small>Note: The /Users/&lt;username&gt;/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.</small></html>| |**macOS**|<code>/Users/<username>/Library/Application Support/Zotero/Profiles/<randomstring>/zotero</code> <html><small>Note: The /Users/&lt;username&gt;/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.</small></html>|
Line 30: Line 33:
 |**Linux (most distributions)**|<code>~/.zotero/Profiles/<randomstring>/zotero</code>| |**Linux (most distributions)**|<code>~/.zotero/Profiles/<randomstring>/zotero</code>|
  
-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.+</details>
 ===== Data Directory Contents ===== ===== Data Directory Contents =====
  
-The most important file in the data directory is the zotero.sqlite file, which is the database containing the majority of your data: item metadata, notes, tags, etc. When Zotero starts up, it reads the zotero.sqlite file in the active data directory.+The most important file in the data directory is the ''zotero.sqlite'' file, which is the database containing the majority of your data: item metadata, notes, tags, etc. When Zotero starts up, it reads the ''zotero.sqlite'' file in the active data directory.
  
-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. (Files that are [[attaching_files|linked]] are not copied into this subdirectory.)+The directory also contains a ''storage'' folder with 8-character subfolders (e.g."N7SMB24A"containing all of your file attachments, such as PDFs, web snapshots, audio files, or any other files you have imported. (Files that are [[attaching_files|linked]] are not copied into this subfolder.)
  
-Your data 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).+Your data directory will likely contain several other files and folders. These can include ''zotero.sqlite.bak'' (an automatic backup of ''zotero.sqlite'', which is updated periodically if 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), as well as folders such as ''locate'', ''logs'', ''pipes'', ''styles'', and ''translators'' that are created automatically at Zotero startup.
  
 **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. **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.
Line 44: Line 47:
 ===== Backing Up Your Zotero Data ===== ===== Backing Up Your Zotero Data =====
  
-We strongly recommend that you regularly back up your Zotero databaseSyncing is not a good substitute for backing up: the Zotero servers only store the most recent version of your libraries, and it takes just a single (possibly automatic) sync to change the server copy.+We strongly recommend that you regularly back up your Zotero data directoryWhile [[:sync|syncing]] is a great way to make sure you can restore your libraries if something happens to your computer, it'not a complete substitute for a proper backup: the Zotero servers only store the most recent version of your libraries, and it takes just a single (possibly automatic) sync to change the server copy (though some inadvertent changes can be restored from [[#restoring_from_the_last_automatic_backup|Zotero's automatic backups]]).
  
 Rather than backing up just your Zotero database, we recommend using a backup utility that automatically backs up your entire hard drive to an external device on a regular basis and keeps incremental backups so that you can restore to a given version. Most modern operating systems offer such functionality (e.g., Time Machine on Macs). Rather than backing up just your Zotero database, we recommend using a backup utility that automatically backs up your entire hard drive to an external device on a regular basis and keeps incremental backups so that you can restore to a given version. Most modern operating systems offer such functionality (e.g., Time Machine on Macs).
  
-If you really want to back up your Zotero data specifically, [[zotero_data#locating_your_zotero_data|locate your Zotero data]], close Zotero, and copy your data directory (the //entire folder//, including ''zotero.sqlite'' and ''storage'' and the other subfolders) to a backup location, preferably on another storage device. As with all important data, it's a good idea to back up your Zotero data frequently (which is why we recommend an automated full-system backup instead).+If you really want to back up your Zotero data specifically, [[zotero_data#locating_your_zotero_data|locate your Zotero data]], close Zotero, and copy your data directory (the //entire folder//, including ''zotero.sqlite'' and ''storage'' and the other subfolders) to a backup location, preferably on another storage device. As with all important data, it's a good idea to back up your Zotero data frequentlywhich is why we recommend an automated full-system backup instead
 + 
 +Note that if you're using "download files as needed" for file syncing, your attachment files may not all exist locally and may not be included in a backup. Zotero Storage provides reliable storage of uploaded files, so you might choose to exclude the ''storage'' folder from your backup, but if you'd like a local backup of attachments as well, you would need to use "download files at sync time" on one computer and make a backup of the data directory from that computer.
  
 **Warning**: You shouldn't use export (e.g., to Zotero RDF, BibTeX, or RIS) as a backup method. Exporting and re-importing a library doesn't produce an exact copy — it will reset Date Added/Modified times and break links to existing citations in word processor documents, along with other potential changes. **Warning**: You shouldn't use export (e.g., to Zotero RDF, BibTeX, or RIS) as a backup method. Exporting and re-importing a library doesn't produce an exact copy — it will reset Date Added/Modified times and break links to existing citations in word processor documents, along with other potential changes.
Line 68: Line 73:
 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. 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 folder.) 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 folder to "Zotero-Old". Next, copy the data directory from your backup to the original location (e.g., "Zotero").+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 folder.) Click "Show Data Directory", which should reveal your active data directory containing zotero.sqlite and possibly a 'storage' subdirectory. Close Zotero, change to the parent folder of the active data directory (Cmd-up-arrow on macOS, Alt-up-arrow on Windows), and rename the folder 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. When you reopen Zotero, you should see your restored Zotero data.
zotero_data.1656056089.txt.gz · Last modified: 2022/06/24 03:34 by dstillman