Failure to restore backup

Hi!

I recently changed the HDD of my laptop, where I had my Zotero database stored locally. The more recent version of the library had for some reason failed to upload on the server (I subscribed to additional space).

In the meantime, I have my old HDD in a casing, and had also backed it up on a flash drive. When following the restoration procedure from both backups. However, it only retrieves data that was saved a year ago. Till I had done the HD upgrade, my library seemed to the latest one (saved locally). The original Zotero folder of the older drive, still seems to contain files I have added recently in my library (in 'storage').

After trying various combinations, I am still unable to restore the latest library to Zotero. The online library too shows more or less the same data, though I usually keep auto-sync off, and have done so now.

I would be grateful for your help and advice as it seems I may lose a lot of data.

Thank you!
  • could you say exactly what you did to restore your database?
  • Thanks for your response. I followed these instructions:

    "click “Show Data Directory”. This should reveal your active data directory containing zotero.sqlite and possibly a 'storage' subdirectory. Close Zotero Standalone and move zotero.sqlite and 'storage' from this folder into a temporary folder on your desktop. Next, copy — don't move — zotero.sqlite and 'storage' from your backup into the active data directory."

    I had more tahn one of these zotero.sqlite.bak files and a numbered one (zotero.sqlite.[highest-number].bak)and 'storage'. Since this didnt work, I tried various combinations, copying the whole directory, copying only the numbered file and so on. So far teh result has been the same though.
  • in your back-up you should actually have a file zotero.sqlite -without .bak, without a number of anything. It should be several megabytes in size (no smaller than 2, likely larger than 10, possible over 100). Copy that into the currently active data directory, replacing the existing zotero.sqlite, which will be about 1MB in size.).
    Do all of this while Zotero/Firefox are closed.
  • Hi,

    I did this. It shows the same library again (I copied it from C drive where my original Zotero folder is saved). It is the same 30 MB file on my all my backups as well.

    I am going to have the HDD opened and try to check Standalone on that older PC. From what it looks like, I am beginning to suspect that somehow my local folder has been synced with my online library which is old. Though that should not be the case as I keep auto-sync turned off all the time, and till I had changed the HDD, the local files were alright. I opened the storage folder in the original Zotero library in the old HDD, and there seems to be recently saved files there, but these are somehow not appearing in the library of standalone.

    What would be my options in these circumstances?

    Thanks again.
  • edited September 3, 2014
    I opened the storage folder in the original Zotero library in the old HDD, and there seems to be recently saved files there, but these are somehow not appearing in the library of standalone.
    ignore files in storage. What matters is the sqlite. Check their modification dates, maybe that can help. Also check if any of the zotero.sqlite.bak files are larger than the zotero.sqlite. If so, see
    http://www.zotero.org/support/zotero_data#restoring_from_the_last_automatic_backup
    (and be sure to make a copy of those.)

    Syncing wouldn't have caused this unless you forced a restore from server, which seems rather unlikely. (Syncing an empty online library with a newer, full local one populates the online one, not the other way around.)
  • My library is not empty, but shows a version of the library from 2013 on adding the backup files. Meanwhile, on my original HDD (which I has reinstalled today to check, the library is the updated one from 2014). In the new HDD where I am trying to copy this library, What is missing are the files between 2013 and 2014 (these files appear on 'Storage' folder on checking), but NOT in the library after re-installation.

    So now, from what I can gather

    I have a few .BAK files:

    .1bak (31 MB approx, larger than the .sqlite file by 1-2 MB)and this seems to be larger than zotero.sqlite.76bak (the latter being only 14 MB.

    From the instructions, just to be clear, I gather that

    1.I take the LARGEST size zotero.sqlite.bak file and name it zotero.sqlite.new (while Standalone is running)

    2. rename zotero.sqlite (non numbered, .sqlite file) to zotero.sqlite.old, rename zotero.sqlite.new to zotero.sqlite, and restart Firefox/Standalone.

    I will do try this now, once I have replaced the HDD with the new one and let you know.

    Thanks!
  • Yes, those are the right instructions in general, but make sure to follow them to the letter (e.g. make copies of files when indicated, turn off Zoter/Firefox at the right time etc.)
  • Well, not exactly to the letter.
    1.I take the LARGEST size zotero.sqlite.bak file and name it zotero.sqlite.new (while Standalone is running)
    You should not rename these files while Zotero is running. That should be "while Standalone is _not_ running"

    But, you say
    on my original HDD (which I has reinstalled today to check, the library is the updated one from 2014).
    , so instead of restoring from a backed up database (.bak file), why not copy over the "zotero.sqlite" (no .bak or numbers or anything) over from the original HDD? Then you'll have exactly what you saw when you opened Zotero from the old HDD.
  • I don't see any harm in renaming the .bak while Zotero is running? It's not an active database.
  • Well, yes, that particular file from a backup does not matter, but the instructions become unclear, since there is no mention of closing Standalone/Firefox before renaming "zotero.sqlite" (which would be bad).
  • yes there is:
    5. Close Firefox/Standalone. In your data directory, rename zotero.sqlite to zotero.sqlite.old, rename zotero.sqlite.new to zotero.sqlite, and restart Firefox/Standalone.

    (or did you just edit that--but I thought I saw that yesterday).
  • I guess we were talking about different things. I meant the instructions recited in this thread by adityakakati. Didn't want him/her (or anyone else reading this) to get confused.
  • yup, sorry, I was talking about:
    https://www.zotero.org/support/zotero_data#restoring_from_the_last_automatic_backup
    I thought that's what they were looking at (that's what they _should_ be looking at), but you're right that may not be the case.
  • I think my previous comment did not upload for some reason. In short,

    I tried this as well several times:

    "so instead of restoring from a backed up database (.bak file), why not copy over the "zotero.sqlite" (no .bak or numbers or anything) over from the original HDD"

    But on doing this, the same 2013library appears.

    Meanwhile while trying https://www.zotero.org/support/zotero_data#restoring_from_the_last_automatic_backup
    I encountered a conflict: I have two 'zotero.sqlite' files in the folder. One is a .sqlite file (30,476 kb), and the other a .bak file (the latter is marginally bigger in kb, being 30,564 kb). The prompt wanted to rename the conflicted files to zotero.sqlite(2).

    Then there are also two other .bak files, zotero.sqlite.1 (30, 560 kb) and zotero.sqlite.76 (14,120 kb).

    Now I am quite confused as to what to do or which files to proceed with (and what to do with the other .bak files?)

    The zotero.sqlite file from the old HDD is the same size more or less. The contents of the 'storage' folder even in the newly installed Zotero shows data added much later, but somehow this does not show in the library, under the various headings I had made.

    I am a bit confused as to what I should finally follow now under these circumstances. Please help.

    Thanks
  • Let's go back to the following comment that you made
    on my original HDD (which I has reinstalled today to check, the library is the updated one from 2014).
    Is that still the case? The Library you see on your old hdd is exactly what you want on your new one, correct?
  • The Old HDD (which is now in the form of an external drive) on being installed into the laptop again temporarily showed the latest library I want. Indeed, this is the one I want on my new HDD now.
  • Hi, my problem is still not resolved yet. could you please help to follow through from where we left?

    "The Library you see on your old hdd is exactly what you want on your new one" is exactly what I want to do
  • Sorry for the long delay. Carefully follow the instructions here after opening your library from the old HDD (use the show data directory button to locate your library). Then follow the same directions to back up your current library (let us know if you want to merge the two at this point). Finally, follow the directions here to restore the backup of the old HDD to your new HDD (use the show data directory button while viewing your new Zotero library)
  • Hi, I'm having a similar problem to those described here. I had to reformat my HD. I reinstalled Zotero, and I have the SQLITE file, both with and without a BAK suffix. How do I get the information from this file(s) into the newly installed and empty version of Zotero? I read something about 'Show Data Directory' above, but am not clear where to look for this term. Could someone provide step by step directions?
  • Look at this:
    https://www.zotero.org/support/zotero_data#restoring_your_zotero_library_from_a_backup1
    This gives you what we believe are detailed, step-by-step instructions. If anything is unclear, feel free to ask, but be as specific as possible with any questions.
  • Thank you, I tried this. I think the problem comes at this step: "Next, copy — don't move — zotero.sqlite and 'storage' from your backup into the active data directory." I tried this but am unsure where the active data directory is located. Two questions: 1) Am I basically copying the SQL file(s) from that same folder to the temporary desktop, closing Zotero, and copying from the desktop back to the original folder? 2) I found three files: one named zotero, listed as SQLITE file; one named zotero.sqlite, listed as a BAK file, and a zotero.sqlite-journal file, listed as SQLITE-JOURNAL File. Which of these do I copy back to the active data directory? The first two files are each 2.32 MB, the third is 88.6 KB.
  • 1) Well, you're copying the sqlite from your back-up to the currently active Zotero data folder. That's the folder that shows up when you go into the Zotero preferences, advanced, files and folder and click on "Show Data Directory." You don't really need the desktop for this at all.

    2) just this one: "one named zotero, listed as SQLITE file";
    though ideally also the folder named "storage" from your back-up.
  • Thank you, this time it worked! The backup and active directory had very similar file paths, which caused the confusion. Thanks very much.

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.