User error. Contents of Writer file deleted

Discuss the word processor
Post Reply
Noneic24
Posts: 2
Joined: Thu Jun 19, 2014 10:31 am

User error. Contents of Writer file deleted

Post by Noneic24 »

Morning Guys, this is my first foray into the world of Open Office. I have been asked by a friend to try and recover the contents of a Writer file that were deleted and the file was then saved. I won’t get to look at the computer until later today so I am just after any advice on what I might be able to try. I am told the computer runs Windows 7 with Open Office 3, I have done some searching on this forum and found where the profile should be so that will be my first port of call. I have read that by default the option to make a backup whenever saving is not turned on by default :( is that correct?

Apart from taking the PC off the owner and giving her an abacus does anyone have any suggestions of what I can try?
Open Office 3.1 Windows 7
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: User error. Contents of Writer file deleted.

Post by RoryOF »

On your own computer download PhotoRec or Recuva. Then transfer this to a USB stick, observing the correct USB removal protocol. Boot the target computer and run the recovery utility, Go away and have coffee while it runs (won't be fast),

If no success with the recovery utility, look in the default backup directory and the temp directory used by OpenOffice, pointed to by /Tools/Options/OpenOffice : Paths. If there is a .bak file or files with arbitrary names (sdytg.fgh sort of thing), rename these to .odt or .doc, depending on what file type she was using, and see if there is any relevant data in them. Bring box of tissues!
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: User error. Contents of Writer file deleted.

Post by John_Ha »

Noneic24 wrote:I have been asked by a friend to try and recover the contents of a Writer file that were deleted and the file was then saved.
 Edit: See [Tutorial] How to find and un-delete Writer temporary files for a more comprehensive post.

The Tutorial is often updated. 
The "save a backup copy" is not switched on by default. The folder is specified in Tools > Options > OpenOffice > Paths.

1 Stop them using the computer NOW - the more they use it, the more likely something you want will be overwritten. But don't switch it off or let it hibernate - when it hibernates, or re-boots, it writes its paging file which is large and over-writes a large area of disk.

 Edit: This only works if you were editing a .odt file - it does not work if you were editing a .doc file. 

 Edit: See Using Recuva to un-delete Writer temporary files for help recovering the temporary files which Writer wrote while you were editing the document, and then deleted when Writer was closed.

The post has been extensively updated [June 2016] to show how AutoRecovery files can be un-deleted for .odt files; for files which have never been saved; and for .doc files.
 

2 If the file was open, and data was added, and that data was deleted, and the file was then saved, you may be able recover the deleted data as below, especially if they had AutoSave set such that Writer AutoSaved every few minutes..

Writer uses temporary files to hold data, and you might be able to recover these temporary files which will now have been deleted by Writer when Writer (AOO?) closes) so they will not be in the Recycle bin. But, if you are lucky you might get them back with Recuva.

1 Tools > Options > OpenOffice > Paths > Look for where the temporary files are stored - in Windows 7 mine are located in C:\Users\John\AppData\Local\Temp\. The user may have Windows set up such that these are hidden files - if so, switch on "Show hidden files" by opening any folder in Windows > Tools > Folder options > View > Show hidden files (and possibly un tick Hide protected system files). Also, un-tick Hide extensions for known file types. Remember to undo this afterwards if you want to ...

2 The following is a based on opening a .ODT file and watching what happens.

When Writer starts, it creates a folder in ...\Temp called something like C:\Users\John\AppData\Local\Temp\svbhjgpu.tmp. Note that svbhjgpu.tmp looks like a file because it is named svbhjgpu.tmp but it is NOT a file - it is a FOLDER.

Inside that folder Writer creates a number of files svbhjXXX.tmp where the first (up to 5) characters are the same as the the first (up to 5) characters of the folder name, and XXX are random characters. Hence these files are C:\Users\John\AppData\Local\Temp\svbhjgpu.tmp\svbhjXXX.tmp. The first the .odt file you are editing, as it was when last saved - this is the file you want as it contains the text and images. The other files are the images in the document, stored as GRF format, or as JPG or PNG format. You want to un-delete all these files, find which is the .odt file, and rename it Fred.odt.

There will probably be several folders, one for each time Writer opened this or another document. Look for the most recent ones and work backwards to the older ones.

...\Temp\svbhjgpu.tmp folder containing 2 files - you need to recover these two files.
...\Temp\svbhjgpu.tmp folder containing 2 files - you need to recover these two files.
3 When Writer (AOO?) closes, it (usually, but not always) deletes all these temporary folders and files. It is worth just checking to see if any are still there.

If none are there, your challenge - successful in many cases - is to find the deleted tmp files with a utility like Recuva.

When you do find them, try to unzip them. With luck, one will unzip - it is the .odt file for which you are looking. Rename it Fred.odt and open it with Writer.

If it will not open, all is not lost. Unzip it and look for a file called content.XML. content.XML is a flat ASCII file, so open it with Notepad and look for your text. Notepad opens it, but the XML is just a single line with no line breaks (it can have 100,000+ characters in the single line) so it is a bit (read a lot!) more difficult to see the data.

It is easier to open it with a editor capable of "pretty printing" XML (eg Notepad++ with the XML Editor add-on > Plug-ins > XML Tools > Pretty print with line breaks).

If the ODT file has been saved previously, when Writer opens it, Writer creates a copy of it in \Temp.

If a new document is created, then the files in \Temp are empty (0 bytes) until the document is saved. When Writer Autosaves a document which has not been saved with File > Save As ... , and therefore does not have a proper name, Writer AutoSaves it into the backup folder (See Paths - mine is C:\Users\John\AppData\Roaming\OpenOffice\4\user\backup\) as ...\Backup\untitled_0.odt.

One strange thing - this is based on when the user saves in odt format. When I opened a .doc file, I could not see any temporary files in ...\Temp.
 Edit: It seems that, while Writer creates a temporary file for the document when you are editing a .doc file, the file is zero bytes long and Writer does not store any data in it. Writer does store the images from the document as temporary files. You cannot therefore use this method to un-delete the text contents of a .doc file 
This is a picture of some temporary files in ...\Temp\sv166h3z.tmp folder while Writer has a document open. When Writer (AOO?) closes, these tmp files should get deleted.
Several sv166XXX.tmp files stored in the sv166h3z.tmp folder - they are therefore ...\Temp\sv166h3z.tmp\sv166XXX.tmp, where XXX are random characters
Several sv166XXX.tmp files stored in the sv166h3z.tmp folder - they are therefore ...\Temp\sv166h3z.tmp\sv166XXX.tmp, where XXX are random characters
 Edit: EDITED to correct errors and add information. 
If you want to try this before you get problems, then open a .odt file and leave Writer open. Now go to .../Temp and look for a folder named something like abcdefg.tmp. Look inside that folder and you should see at least one .tmp file which has the same first two (or more) characters as the folder name. Writer owns these files so you cannot even look inside them, but there is a trick - take a copy of the file. Do this by right-click the file > Copy. right-click in the white area of the window > paste. This pastes a copy of the file in the same folder and you can open these files with your Zip utility or Notepad or Notepad++.[/strike]
Last edited by John_Ha on Thu Jul 06, 2017 2:15 pm, edited 11 times in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Bill
Volunteer
Posts: 8929
Joined: Sat Nov 24, 2007 6:48 am

Re: User error. Contents of Writer file deleted.

Post by Bill »

Right-click the file in Windows Explorer and select Properties. Click the Previous Versions tab.
AOO 4.1.14 on Ubuntu MATE 22.04
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: User error. Contents of Writer file deleted.

Post by John_Ha »

Bill wrote:Right-click the file in Windows Explorer and select Properties. Click the Previous Versions tab.
I have never been able to get that to work even though I have got protection switched on for the disk.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Bill
Volunteer
Posts: 8929
Joined: Sat Nov 24, 2007 6:48 am

Re: User error. Contents of Writer file deleted.

Post by Bill »

Maybe that's why it was removed from Windows 8 in favor of File History.
AOO 4.1.14 on Ubuntu MATE 22.04
Noneic24
Posts: 2
Joined: Thu Jun 19, 2014 10:31 am

Re: User error. Contents of Writer file deleted.

Post by Noneic24 »

Thanks for the replies but I could not recover the file or any of the temp files, the good thing to come out of it is that she now has a backup device and automated software so as long as she remembers to plug the drive in regularly it should not happen again.
Open Office 3.1 Windows 7
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: User error. Contents of Writer file deleted.

Post by RoryOF »

The only consolation arising from a necessitated rewrite is that the rewrite is usually better - with any luck the author has the layout and treatment of the text, be it project or fiction, in his/her mind and can get it down precisely.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: User error. Contents of Writer file deleted.

Post by jrkrideau »

Noneic24 wrote:Thanks for the replies but I could not recover the file or any of the temp files, the good thing to come out of it is that she now has a backup device and automated software so as long as she remembers to plug the drive in regularly it should not happen again.
Prop the abacus in a prominent place near the backup device as a reminder. :twisted:
LibreOffice 7.3.7. 2; Ubuntu 22.04
Tech120
Posts: 2
Joined: Tue Jun 24, 2014 6:26 am

Re: User error. Contents of Writer file deleted

Post by Tech120 »

There is no Previous Versions tab under Properties for the document with which I experienced similar issues:

I first created a document in Wordpad, opened it in OpenOffice, edited it, saved it in the current format, and closed the file. I edited it in OpenOffice several times afterward over a few hours. Around 6:30PM EDT, I attempted to save and close it. The entire page became highlighted in light blue, like a shadow, and stopped responding. After a couple of minutes, the highlighting ceased and I closed the file before shutting down my pc.

When I rebooted a few hours later and tried opening the document, I got this popup, "General error. General input/output error." When I clicked OK, the popup and the now-empty document closed. I searched the internet for that error message and found nothing.

I was able to open it in Wordpad, but almost all the data was missing, all the research notes I c&p from online sources to read offline later-gone! Data that had been saved several times over-gone.

Is there any way to get it back?
OpenOffice 3.4 on Windows Vista
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: User error. Contents of Writer file deleted

Post by RoryOF »

Try the Backup folder for a .bak file. Look in OpenOffice's Temporary documents folder and rename any files to type .odt (or ,doc, as appropriate). See if they will open. If no luck, run a recovery utility (Recuva or PhotoRec) and see if it finds a deleted temporary file.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Tech120
Posts: 2
Joined: Tue Jun 24, 2014 6:26 am

Re: User error. Contents of Writer file deleted

Post by Tech120 »

Thank you. I will try downloading a recovery utility. I notice there are no backup files on this computer. Does this mean that a recovery utility would be moot? This is a refurbished desktop I set up about a week ago, and I'm adjusting from being a savvy XP user to learning Vista and a newer version of OpenOffice minus my favorite add-ons.
OpenOffice 3.4 on Windows Vista
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: User error. Contents of Writer file deleted

Post by John_Ha »

Tech120 wrote:Is there any way to get it back?
See my earlier post - it's the third in this sequence above. You are relying on getting back the temporary files created while you were editing the file. It does work sometimes - I have recovered files doing it.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: User error. Contents of Writer file deleted

Post by RoryOF »

If you have your old XP machine, you could consider running one of the Linux distros on it (try out from live CD or better from a live USB). Slowish off the live USB/CD but when you install to the disk drive It will fly!

The OpenOffice add-ons can be downloaded from
http://extensions.openoffice.org/

A recovery utility is useful to have preinstalled in a Windows computer; you can put it into action as soon as needed. The less disk access and computer use before recovery the better prospects for success.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Bill
Volunteer
Posts: 8929
Joined: Sat Nov 24, 2007 6:48 am

Re: User error. Contents of Writer file deleted

Post by Bill »

Tech120 wrote:There is no Previous Versions tab under Properties for the document...
Shadow copies of documents will be saved in Vista if System Restore hasn't been turned off, but the home version of Vista doesn't have the Previous Versions tool to recover the shadow copies. They can be recovered using ShadowExplorer.
AOO 4.1.14 on Ubuntu MATE 22.04
Post Reply