Asking to re-sync?

When I opened my Zotero it said I was about to sync my account to an empty database. I haven't changed the directory of my Zotero database, it's a folder called Zotero in Documents (on Mac), and the data directory still points there. When I log in to zotero.org I still see all my data. Didn't want to click the wrong thing and accidentally make it all disappear! Should I reenter my login in the Zotero desktop version and sync to online?
  • edited April 26, 2020
    If you go to your data directory, what are the names, sizes, and dates of all zotero.sqlite* files in that directory? Is there a 'storage' directory, and does it contain folders with dates corresponding to your previous usage of Zotero? (This is all to determine if this is the data directory you were using previously and something just happened to your database or if this is a new, empty data directory and your previous data directory is elsewhere.)

    Also, is your Documents folder synced via iCloud? If so, you absolutely should not keep your data directory in there — that's one of the reasons Zotero uses the home directory rather than the Documents directory by default.
  • Thanks for this! Yeah I put it in the Documents folder because a librarian had suggested that (and I think me doing that predates my current iCloud situation...). I think I've also inadvertently created a really huge Zotero database (8GB) because I was syncing attachments as well.

    There are A LOT of zotero.sqlite files. All those that are zotero.sqlite.1.[something].bak are in the 40 MB range. Then there's zotero 2.sqlite (and 3 and 4) that are only 1 MB (and seem to be the newest files). I think the newest of the files in the 40 MB range is from February 5th 2020. In the storage directory the newest folders are from Feburary 4th 2020.

    It's definitely possible that early February is the last time I made real changes to my library and that I've only been "passively" using it since then.
  • edited April 26, 2020
    What's the size of zotero.sqlite itself, though?

    Zotero creates .bak files, but "zotero 2.sqlite" and the like aren't files that Zotero creates, so I'd guess that those are files iCloud created due to conflicts.

    You should close Zotero, make a backup of all the .sqlite files, move the data directory back to the default location in your home folder (/Users/:username/Zotero), and rename the latest 40 MB file to zotero.sqlite. When you then start up Zotero, it should notice that the data directory is missing at the previous location and ask if you want to use the default location. Say yes, and it should start up with, hopefully, your correct database as of February 5.
  • The zotero.sqlite file is 43.3 MB and also dates to February 5th. By "moving the data directory" you mean moving files around (just the zotero.sqlite or more)? And only then changing the directory path in Zotero settings?

    Thanks again. Yes I think the zotero 2.sqlite etc. is what was created today when I opened Zotero and it thought it was empty.
  • edited April 26, 2020
    No, don't move files individually. Just move the "Zotero" folder out of Documents and back into your home folder, where it goes by default. Then delete the existing zotero.sqlite and rename the most recent .bak to zotero.sqlite. (Again, this is after you've backed up all the sqlite files separately.)

    A 43 MB file certainly shouldn't be empty, but if the database is corrupted it might show up that way.
  • Ok thanks, that makes sense now that I've looked at how those files are organized for the first time. And should I delete the very small and strange zotero 2.sqlite (and 3 and 4) files as well?
Sign In or Register to comment.