Page 1 of 1

Overwrote a file but original text is in cache somewhere

Posted: Mon Sep 16, 2019 4:22 pm
by Krenzathal
Hi folks,

I'm livid right now so please let me explain what is wrong:

I accidentally pushed CTRL + S and overwrote another document. OpenOffice didn't even ask me if I was sure, but to add insult to injury, unlike any of my other applications there was absolutely no auto backup file of any kind made or any previous versions saved.

However, here's the thing: when I search for this file in Windows explorer it comes up, but the little preview is the original document! The text must be saved in some cache somewhere so if I can just access that I can copy the words over, but I have no idea how to. When I open the document in OO it's just the overwritten file that loads, but that Windows Explorer preview has the original text, and I MUST get it back at all costs.

I'm not touching anything in case that cache gets overwritten, so if anyone can quickly advise me on this I'd be most grateful.

Re: Overwrote a file but original text is in cache somewhere

Posted: Mon Sep 16, 2019 5:04 pm
by Bill
If the "little preview" is the thumbnail icon, that's probably coming from the Windows thumbnail cache which does not contain the actual document.

Did you right-click the document file in Windows Explorer and select "Previous Versions"? Previous versions are saved by Windows, not individual applications. AOO does have an auto backup option which stores the penultimate version, but that option must be enabled by the user.

Re: Overwrote a file but original text is in cache somewhere

Posted: Mon Sep 16, 2019 5:10 pm
by Krenzathal
Thanks for the reply bill.

Yes it's the thumbnail but it also partially shows text from the content of the file, and that content is from the original document. I've searched for any previous version but I can't find any, so why is it showing the text from the overwritten document in that preview if there is not a copy anywhere?

Re: Overwrote a file but original text is in cache somewhere

Posted: Mon Sep 16, 2019 5:18 pm
by RoryOF
Ctrl S will entirely have overwritten any previous version of that file. Presumably you took an existing file, edited to suit your requirement, then, without changing its name, Saved it under the original file name. There will only be your new content.

Re: Overwrote a file but original text is in cache somewhere

Posted: Mon Sep 16, 2019 5:26 pm
by RusselB
The thumbnail is a small picture of the document, so the text will appear in the picture.
This information is stored in a hidden Windows folder...sorry, I don't recall which one in order to help you locate it.
Usually the pictures are too small for usage as you are wanting to do, even if you printed the picture and then scanned it into Writer.

Don't search for the old file using Windows Explorer, instead locate the new file that was saved using the same name, then follow Bill's instructions regarding Previous Versions on that file.

Re: Overwrote a file but original text is in cache somewhere

Posted: Mon Sep 16, 2019 5:59 pm
by MrProgrammer
Hi, and welcome to the forum.
Krenzathal wrote:OpenOffice didn't even ask me if I was sure …
This follows normal operation for most applications. They don't ask for confirmation of a Save operation. They do typically ask if you use Save As to overwrite an existing file. But you didn't use Save As, you used Save (Ctrl+S on Windows).
Krenzathal wrote:… unlike any of my other applications there was absolutely no auto backup file of any kind made or any previous versions saved.
No. If you enabled option OpenOffice → Preferences → Load/Save → General → Always create backup copy, OpenOffice saved the previous content in its backup directory. Options are set with OpenOffice → Preferences on a Mac, Tools → Options on other platforms. If you don't know where the backup directory is, view option OpenOffice → Paths. You would preserve the backup copy using your operating system, not OpenOffice:
• Backup directory\MyOverwrittenFile.bak ➜ MyDocuments\MyNewFile.odt
Krenzathal wrote:When I open the document in OO it's just the overwritten file that loads …
Bad move. If you use OpenOffice to close MyOverwrittenFile.odt and reopen it before preserving the BAK file, you will lose your backup copy.
Krenzathal wrote:I'm not touching anything in case that cache gets overwritten.
The preview you see is probably a tiny picture of a single document page, so even if you could find the preview it is useless for recovering your text. However, if you have not closed the document in OpenOffice there is a "cache" of sorts. You can use Edit → Undo to revert each change up to your Undo limit (option OpenOffice → Memory). You can undo changes across a Save operation. Perhaps this will get you closer to your original content and then you can use File → Save As to create a new file.
Krenzathal wrote:I accidentally pushed CTRL + S and overwrote another document.
I have learned that if one intends to create a new document based on an existing one which should be preserved it is best to use File → Save As immediately after opening the existing document, before making the first change. This prevents the panic you're experiencing. Another method is to use File → Open → Options → Read only since you won't be able to make any changes to the document until you create a new file with Save As.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.

Re: Overwrote a file but original text is in cache somewhere

Posted: Mon Sep 16, 2019 6:10 pm
by RoryOF
MrProgrammer wrote:
Krenzathal wrote:I accidentally pushed CTRL + S and overwrote another document.
I have learned that if one intends to create a new document based on an existing one which should be preserved it is best to use File → Save As immediately after opening the existing document, before making the first change. This prevents the panic you're experiencing.
I agree - one should immediately name a file (/File /Save as). Also, to avoid such situations, is why Templates are used.

Re: Overwrote a file but original text is in cache somewhere

Posted: Mon Sep 16, 2019 11:29 pm
by John_Ha
Krenzathal wrote:I'm livid right now ... there was absolutely no auto backup file of any kind made or any previous versions saved.
That's your fault. If you had read the manual or checked the options you would have seen how to enable it. A bad workman always blames his tools.

The icon picture is created with the file contents at the time the icon is created. If you later edit the file contents the icon image does not change.