Making a Copy of your Zotero Data at a Non-Sync Location
How are users handling non-sync local backups? The Cloud is wonderful, and many users have Zotero on several computers and devices, all syncing with the cloud. But if one link fails, its errors may cascade to all the others.
Zotero recognizes the problem, and recommends one copy of the database and documents folder in a location that does not sync. The recommendation includes a link to one solution, which involves locating the data in the user’s profile, e.g. under Firefox, and then dragging to create a copy in another location, preferably on a different physical drive. This works, but only if the user remembers to do it fairly often.
MSDOS includes XCOPY, which enables copying of entire directories, with options to copy only newer versions and files and otherwise facilitate use of the backup. Here is a simple Batch file that does that:
-------------------------------------------------
REM Manual backup of Zotero data to a NON-synced directory
REM prevents corruption of the backup if the main files have been damaged
REM Allows User to Quit program if there are signs of corruption
REM Can be Run at Startup by Adding a shortcut to the Startup Folder of the Windows Start Menu
@ECHO OFF
CLS
ECHO[
ECHO "COPY Zotero Data from Profile on c: to d:\My Documents\zotero"
ECHO[
ECHO "Do NOT Proceed if your Sync working copy of Zotero has been Damaged"
ECHO[
ECHO "Press <Ctrl> c to Quit this Program Now Or"
ECHO[
pause
ECHO ON
xcopy "C:\Users\Judson\AppData\Roaming\Mozilla\Firefox\Profiles\148bb9cz.default\zotero" "D:\My Documents\zotero" /c /d /e /h /i /k /q /r /s /x /y
pause
EXIT
--------------------------------------------------------
The program first warns the user make the copy only if the source directory is uncorrupted, with an option to exit without copying if one suspects a problem. The program will not continue unless the user presses a key, and can bail with <Ctrl>c. After the copy has been made [if there are no or few changes this is quick, if there are a lot of new files there may be a delay]. Finally, the program summarizes the results, reporting the number of files copied. Pressing a key terminates the program and closes the DOS window, and you are back in GUI heaven.
To write your own version, just substitute your own source and destination directories on the long line near the end of the program. Use any simple text editor, like Windows Notepad, copy the code into a new document, and save it as YouPickName.bat [note it must be .bat, not .txt, or it won’t run]. Zotero docs instruct you how to locate your profile data [your source directory should end with Zotero, which includes both the data and the SQLITE database]. Create a shortcut to that directory and place it on your desktop. Then setup your destination directory, create a second shortcut to it, also on the desktop. Right-Click on each shortcut, Click Properties, then highlight the target path and copy it into the batch file in place of my source and destination above.
Save the .bat file to a directory accessible by any user who may need it [I put it in the root of c: which some would call risky behavior].
Finally, create a shortcut to the batch file. That shortcut can be used to run the program manually, or it can be added to the Startup folder of your Startup menu, so that it runs automatically each time you start a session. Optionally, you can add it to Task Manager and then get fancy, running it only once a week or under other conditions.
I think an equivalent approach in Linux would utilize the rsync command.
Judson Jennings
Seton Hall Law School
Zotero recognizes the problem, and recommends one copy of the database and documents folder in a location that does not sync. The recommendation includes a link to one solution, which involves locating the data in the user’s profile, e.g. under Firefox, and then dragging to create a copy in another location, preferably on a different physical drive. This works, but only if the user remembers to do it fairly often.
MSDOS includes XCOPY, which enables copying of entire directories, with options to copy only newer versions and files and otherwise facilitate use of the backup. Here is a simple Batch file that does that:
-------------------------------------------------
REM Manual backup of Zotero data to a NON-synced directory
REM prevents corruption of the backup if the main files have been damaged
REM Allows User to Quit program if there are signs of corruption
REM Can be Run at Startup by Adding a shortcut to the Startup Folder of the Windows Start Menu
@ECHO OFF
CLS
ECHO[
ECHO "COPY Zotero Data from Profile on c: to d:\My Documents\zotero"
ECHO[
ECHO "Do NOT Proceed if your Sync working copy of Zotero has been Damaged"
ECHO[
ECHO "Press <Ctrl> c to Quit this Program Now Or"
ECHO[
pause
ECHO ON
xcopy "C:\Users\Judson\AppData\Roaming\Mozilla\Firefox\Profiles\148bb9cz.default\zotero" "D:\My Documents\zotero" /c /d /e /h /i /k /q /r /s /x /y
pause
EXIT
--------------------------------------------------------
The program first warns the user make the copy only if the source directory is uncorrupted, with an option to exit without copying if one suspects a problem. The program will not continue unless the user presses a key, and can bail with <Ctrl>c. After the copy has been made [if there are no or few changes this is quick, if there are a lot of new files there may be a delay]. Finally, the program summarizes the results, reporting the number of files copied. Pressing a key terminates the program and closes the DOS window, and you are back in GUI heaven.
To write your own version, just substitute your own source and destination directories on the long line near the end of the program. Use any simple text editor, like Windows Notepad, copy the code into a new document, and save it as YouPickName.bat [note it must be .bat, not .txt, or it won’t run]. Zotero docs instruct you how to locate your profile data [your source directory should end with Zotero, which includes both the data and the SQLITE database]. Create a shortcut to that directory and place it on your desktop. Then setup your destination directory, create a second shortcut to it, also on the desktop. Right-Click on each shortcut, Click Properties, then highlight the target path and copy it into the batch file in place of my source and destination above.
Save the .bat file to a directory accessible by any user who may need it [I put it in the root of c: which some would call risky behavior].
Finally, create a shortcut to the batch file. That shortcut can be used to run the program manually, or it can be added to the Startup folder of your Startup menu, so that it runs automatically each time you start a session. Optionally, you can add it to Task Manager and then get fancy, running it only once a week or under other conditions.
I think an equivalent approach in Linux would utilize the rsync command.
Judson Jennings
Seton Hall Law School
Thanking you in advance,
Estefanía Gómez Cotino