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/08/13 04:26] – [Default Locations] dstillmanzotero_data [2023/07/13 17:52] (current) – [Backing Up Your Zotero Data] dstillman
Line 36: Line 36:
 ===== 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 47: 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 71: 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.1660379160.txt.gz · Last modified: 2022/08/13 04:26 by dstillman