Restore a deleted collection?

Hello,
My problem: Moments ago I accidentally deleted a collection (with two sub collections) from my Zotero library (on computer "A"). First, I tried to edit/undo, but this wasn't possible. Second, I checked the Zotero trash, but it wasn't there. Third, I tried to restore data from the Zotero Server, and it deleted all my local files, but when it restored it did so without the deleted collection, which makes me think it synced in the moment between my deleting it and noticing it was deleted. When I check my library online the missing collection is, in fact, missing.

My first question is this, is there a spot where I can locate the missing collection (and sub-collections) and I'm just too stupid to figure this out? Or, are they truly gone?

My next question is this, I have Zotero on another computer (computer "B"), and I quickly shut off syncing on that computer and the missing collection (and sub-collections) is still there. Is there a way I can upload the missing collection from computer "B" to the Server, which will then add the collection to my library on computer "A"? Is that what a "Restore to Zotero Server" would do? Rewrite the material from what I have in computer "B"?

Thanks for any help you can provide.
  • the first thing to note is that you deleted only the collections, not the material _in_ the collection, which you can still find in "My Library".

    You have two options, I think:
    1. On computer B, create reports from the collection and subcollection and use those to (manually) recreate the collections on computer A.

    2. From computer B, use "Restore to Server"

    Option 1 is preferable if you have a lot of work on computer A that hasn't yet synced to computer B. Option 2 would delete any such work, but would, obviously, be a good bit faster.
  • adamsmith, thank you for your first response, and also your first comment. In my fear of losing the collection I had forgotten that I would not have lost the materials in them, that they would still be in my library. Thanks for the idea of option 1, despite the tediousness of it computer A has the most updated information, all computer B has is the lost collection and sub-collections. Usually I am good about keeping the two computers synced, but this was a busy semester and I fell behind (a good reminder to keep it up!).

    I will let you know if I have any questions about generating reports, etc.

    Thanks again, I really appreciate it.
  • A variant to Adam's suggestion (which I found online, but somehow can't find anymore):
    - Turn off automatic sync and close Zotero
    - Find out where your zotero.sqlite file is stored and rename it, for instance to zotero.sqlite_old.
    - Rename zotero.sqlite.bak to zotero.sqlite
    - Start Zotero. If you're lucky, you should see your deleted collection again
    - Create a new collection, name it 'Save Me'. Drag all items from the deleted collection into the new collection. This will prevent sync from deleting the information in your deleted collection.
    - Now sync your database. All information you added since the last backup but before you deleted your collection is added to your database again. Your deleted collection will disappear, but you have saved your data in 'Save Me'.
  • A simple undo function would be a lot more convenient, though. I've lost hour trying to recover accidentally deleted collections...
  • Thank you rickus!!!
  • I've just had this problem too. I geniunely cannot believe how silly this is. You have the ability for a recycle bin but if you accidently delete your collection EVERYTHING is gone. I've tried restoring i've tried getting the data back but it's no use. Everything is gone... I'm not happy.
  • You should be able to restore it from one of your automatic backups.
  • I agree that an "undo" option would prevent a lot of frustration...
  • Yes, please, please, please secure the collections in a better way.
    It is so easy to delete them without wanting and it is much to hard to get the data back.
    Maybe a checkbox in the confirmation pop-up would be the quickest way to help many users. Right now deleting a collection is like deleting one entry.
  • edited October 26, 2018
    Agreed that an undo/restore option for collections needs to be added. I just had a glitch where a heap of my collections and subcollections appeared to have duplicated. I deleted a bunch of the duplicates, and it was playing up weirdly so I reopened the program. Upon reopening it I discovered that heaps of collections and subcollections are gone (so presumably they never duplicated in the first place but just showed up as if they were). If there was a redo button it wouldn't matter, but since there isn't I have to hope I can restore some of the collections from another computer.
  • I just experienced the same thing as Riveon after updating to the latest version. Lost my entire library. I have lots of backup files so I am hoping I will be able to recover somehow.
  • Hi there, I've been using Zotero heavily for the past 4-years and it is just in the last 12-months that I've had the problem of missing collections. This has happened numerous times in the last year. But never before. It seems that something has changed that has made it way too easy to delete collections automatically. And like the above comments there is no easy way to get it back. I have thousands of entries and hundreds of sub-folders across my collections. The advice to rebuild manually is outrageous coming from Zotero staff. It's impossible to stay on top of every entry in every folder and sub-folder. Rebuilding is impossible. Thankfully I've been able to catch the fact that a folder is missing early enough to find it on my laptop. What I do is simply rename the master folder and for good measure I move it to another location in my tree and then sync my laptop and it then gets back up onto to the server.

    But honestly, must users have to endure constant heart attacks on behalf of a vital piece of software?

    We absolutely need a double-verify on the delete collection process. I agree a simple checkbox to go with the delete button would save many. This is a real serious problem.

    It's become such a problem I dread every time I go into Zotero to snap entries or even to access my file articles.

    Please help protect collections from accidental deletion.

    Thanks

    b...
  • @shakyegg: We're not aware of anything that's changed in the last year to cause this, nor have we witnessed any problems ourselves, and even you don't say how you think this is happening. A few people have reported the problem Riveon mentioned above of seemingly duplicated collections that then led to accidental deletions, so it seems like there's something there, but we haven't been able to reproduce that either. If you have any further details or reproduction steps, we'd want to know.
    The advice to rebuild manually is outrageous coming from Zotero staff.
    The only comment above from Zotero staff was from me, where I said this:
    You should be able to restore it from one of your automatic backups.
    Obviously that's not a great solution, but it's the best option at the moment, and it doesn't require rebuilding collections manually.

    We're working on undo functionality for collection deletions, which should be available soon.
  • Hey dstillman, thanks for the reply. I believe you had helped me 9-10 months ago when the problem first cropped up. The automatic backups didn't do the trick. But as mentioned above, so far I've been lucky to find the missing collections on my laptop before it synched. I wish I could say what the problem is. I am an expert computer user and file management nut case ;) Plus I'm very attentive to troubleshooting. as mentioned it's now happened 10 or 12 times. I believe it started with Zotero 5.0.

    The only thing I can think of is that the problem may lie somewhere in the create a new collection/subcollection process. I will right click to create a new sub-collection.

    I will start to type the name in and hit enter (without looking as I am looking at the keyboard) and then look back at Zotero and realize the new folder box is still there with "untitled" highlighted and the new name was not entered into the new folder dialogue box.

    So, this may mean that while the keyboard should be entering into the highlighted new collection/sub-collection name field the keyboard strokes are somehow deleting the last collection I had been working on. Maybe when I hit enter thinking it is "naming" and then "creating" the new collection, it is deleting the collection I was last on when I hit enter to create the new collection name.

    I can report that this collection/sub-collection naming issue has happened during every occurrence of collections going missing, since Zotero 5. It always happens when I am in deep organizing with Zotero which always necessitates creating new folders. I'd take a look into that. The bug might be in there.

    Ensuring that when a new collection/sub-collection is being created and the "untitled" is highlighted that indeed when the keyboard is used at that moment that it is entering into the naming filed of the new sub-collection field.

    I think that's where the problem is happening to me. It's not every time. It's intermittent the creating of a new sub-collection problem. What I can also report is in this process when I think I am typing in the new name into the folder and then hit enter, maybe that enter is triggering the delete. But there is no standard prompt that you regularly get with delete. So this could be why the collection seems to disappear with no conscious action on my part to approve the deleting.

    Hope that helps. Otherwise, I can report no other bugs, or weird action of the client.

    P.S. I am using desktop, mac, 5.0.59
  • But there is no standard prompt that you regularly get with delete.
    Not sure what you mean there. There's a confirmation dialog when you go to delete a collection. But if I press Delete immediately after clicking the "New Collection…" button, I am able to trigger the delete prompt before the collection-name prompt appears. The delay between clicking the button and the prompt appearing could also be longer if Zotero was doing something else in the background. I still can't really think of a way the collection could be getting deleted without your pressing the Delete key, but there's at least a period of time during which you could do that and then mistake the confirmation window for the collection-name prompt.

    In any case, the fact that there can be keyboard input before the collection-name prompt appears is certainly a bug in the current implementation, so we'll fix that.
  • @shakyegg: The keyboard input issue when creating a new collection should be fixed in the latest Zotero beta.
  • edited December 27, 2018
    Fortunately, I was able to restore my library from my backups. What happens to me is exactly as described by Riveon. Zotero (Windows) appears to show duplicate collections and subcollections. However, these are not real. If I shutdown and restart Zotero, everything is fine again. I've experienced this several times on different machines with the same library, but I do not know what triggers it. I have a large library with probably several thousand items and PDFs.
  • Hi dstillman, excellent to hear that "there can be keyboard input before the collection-name prompt appears is certainly a bug" wound its way to view and is slated for a fix. That's awesome you found that.

    I think the keyboard input issue is certainly part of it. But like you I am stymied on this troubleshoot.

    I believe I am confident that I've tracked down one issue problem of why at times I can call up the new-collection prompt and not have the keyboard input go in. It's a function of mac OS with the second monitor.

    I have Zotero on my second monitor. So if I have an app active on my main monitor i.e. Outlook and I take my mouse pointer over to the second monitor, hover over a collection and right-click on a collection to create a new collection the new collection prompt will pop up.

    However, if I had NOT clicked first on the Zotero app to activate it, then the keyboard input does not go into the field. So you can hover over Zotero and interact with it on right-click, but the focus of input is not yet on the Zotero app.

    So this obviously has no impact on the delete issue because keyboard strokes are not being recognized by Zotero.

    This leaves me to believe that the problem could be going the other way. Since inevitably, the missing collections are always one of the ones that I had been interacting with in the most recent session, perhaps when I go back to my main monitor at some point, the Zotero app is still accepting keyboard input and I activate a delete while thinking I am working in Outlook. Could be as I usually am going back to Outlook to delete whatever email I had sent myself with the link I needed to snap into Zotero. Still though, I would be sure to have noticed that input I was entering on the main monitor app was not happening.

    I would also notice if a delete prompt was popping up on Zotero on my second monitor (while working on the main). There's no way I could miss that.

    Like I said I'm stymied on this troubleshoot.

    Undo collection delete would be amazing

    Just as good or in conjunction would be perhaps making "cancel" the default on the delete collection prompt as opposed to "delete" being the default. Or not allowing the enter-key to execute a delete and make it a mouse click on the delete button.

    If this last suggestion was implemented it would allow a proper troubleshoot to happen. Since, if collections still get deleted mysteriously after removing the default enter-key to execute a delete, then we'd know that there is another pernicious bug somewhere.

    Thanks for working on this. I simply love Zotero and you folks for making it happen.

    Cheers

    b....



  • I've also done this multiple times in the last year (at least 4). I click an item in a collection to delete (or think I have), press delete and confirm, and the whole collection goes. It may just be that despite seeming to click an item, the item hasn't actually been selected, so the delete command applies to the whole collection - but the confirmation question looks superficially the same as for an item and when adding and deleting multiple entries it's very easy to press confirm without carefully reading the question carefully each time.
Sign In or Register to comment.