Losing Data in iCloud?

edited May 26, 2020
I was trying to create a copy of my Zotero data. I dragged-and-dropped my Zotero folder from my hard drive to iCloudDrive, thinking that a copy of that folder would be created, so that I would end up with two identical folders containing all of my information. Unfortunately, a brand new Zotero folder including files was created, both on iCloud Drive AND on my hard drive. Is there any way I can recover the data that was in the original file?

This is what I see when I open Zotero now: left sidebar = Library; My Publications; Duplicate Items; Unfiled Items; Trash. In the main screen = Welcome to Zotero!

Advanced > Files and Folders > Data Directory Location still shows the location of the original file, but that does not contain an sqlite or sqlite.bak files
  • edited May 26, 2020
    Dragging things to iCloud Drive doesn't create copies — it's just like dragging to any other folder on the same disk. You'd have to hold down Option to copy.

    But what makes you think that it created an empty data directory in iCloud Drive? If you look in the folder on iCloud Drive, what are the names, sizes, and timestamps of the zotero.sqlite* files?

    It's quite likely that all you did here was move the data directory out of the way, so when Zotero next opened it created an empty data directory in the default location. Fixing it should be as simple as deleting the empty data directory and moving the folder from iCloud Drive back to the default location.

    (All moving of the data directory should be done with Zotero closed.)
  • Thanks so much for this prompt answer!! It turns out that after a half hour had elapsed, all of the 'missing" files had reappeared in the new iCloud location.

    One of the reasons I wanted to move this data to iCloud is that I could not access the data from a remote location for several weeks, using a different laptop. Do you think it is problematic to house this data on iCloud rather than a laptop hard drive?
  • You absolutely can't store your active data directory in iCloud. You can copy the data directory to iCloud as a backup or as a way to manually transfer your data to another computer without using Zotero syncing, but if you point Zotero there, you'll corrupt your database and lose data.
  • edited May 26, 2020
    So will it be safe to move the datafilee now from iCloud back to their original location, AFTER deleting the "empty" folder that is currently in the original location?
    Would making an alias on iCloud be better than copying it?
  • So will it be safe to move the datafilee now from iCloud back to their original location, AFTER deleting the "empty" folder that is currently in the original location?
    Yes.
    Would making an alias on iCloud be better than copying it?
    The active data directory can't be synced by iCloud Drive. That's all. I don't know iCloud Drive handles aliases — I'm guessing it doesn't sync the original files, but I don't know for sure — but if you're trying to either make a backup of your data directory or transfer your library to another computer without using Zotero syncing, you should just make a complete copy of the data directory.
  • @dstillman I have been syncing via dropbox for years and haven't experienced any data corruption and must have gotten very lucky! :-)

    Pardon me for not having followed forum debate closely on this, but how exactly is using cloud storage such a bad idea? You write "The active data directory can't be synced by iCloud Drive." Why?

    iCloud ostensibly create perfect sync of all types of files, at least between Mac systems using APFS formatted drives.
  • Your Zotero library is a database file. Database files (made by any program) are designed to be “locked” when they are being accessed. Cloud storage folders don’t respect locking of files. When a cloud storage folder makes changes in the background while the database file is open, that puts parts of the database out of place, corrupting it.
  • That makes sense, and I have apparently just been lucky.

    So, normal scripted backups, using Time machine (mac specific) or rsync would not be a problem, I guess? Some kind of non-manual peace of mind would be nice.
  • The main concern here is simultaneous access -- if you're just using Rsync for back-up (as you would for time machine) that's definitely fine (and, in fact, recommended). Even Dropbox is typically fine if you only have it running on one machine. The main concern is simultaneous access from two locations (although Dropbox will also just freak out over the constant changes to the .sqlite file, so I'd really recommend against that even as a live back-up solution for Zotero and similar)
Sign In or Register to comment.