Tuesday, November 24, 2015

Recover Form post from chrome

Recently I am working on writing a requirement spec on my companies wiki page. After I am done with writing all my ideas, questions, requirements, etc, when I tried to save the wiki page, it redirected to the authentication page (as I opened the page long back, the session got time out and when I tried to publish it, it tried to re-authenticate), which didn't surprised me. But after I provided my user name/password and did a submit, to my horror, there is an exception and I lost all I have typed in. Oh sh*t.

From couple of hours I am working on this and the valuable data I have is completely lost! I don't like to think again and do the same writing again (It is just stupid, I don't think I will think about all the points again because I am doing it for the second time I might not fresh or my mind is not interested to do the work again). So I started thinking is there any way to recover the lost post. When I click on the publish button, the app will do a POST data on the server (at that point of time the 'intelligent' server recognized that the authentication got expired and user has to re-login again). Why the hell did it not warned me saying that you no longer connected to the server, please save. It is a big usability issue on the wiki website.

Anyhow I found way to recover the data if you are using Chrome (and didn't closed the window where the post data happened, even if we moved to the next pages or opened another site it is okey. But if *closed* the tab, no one can save :).

Luckly I didn't closed the tab, because I tried to see in the back pages etc to get my content.

Here is way to recover lost form data in chrome.

You can recover it from the process dump file.

1. Get the process id for that tab. Chrome each tab as a different process. Click on the options menu (the  menu in the top right), go to "More tools", "Select Task manager".


It will list all the tabs (tasks) and the corresponding Process Id.

2. Now go "Windows Task manager" and select the process with that Process Id.

Right click the windows toolbar and select "Start Task Manager"

In the Task manager, go to the Process tab. If the table in process tab don't have PID coloumn, you can select it from the view menu item, choose "Select Columns" and select "PID (Process Identifier).


Now select the Process in the Process tab of the Windows Task Manager. Right click on the corresponding process and "Create Dump file".

It will create a dump file in the temp directory.

3. Using string.exe utility (you can download the windows utility from microsoft website) - https://technet.microsoft.com/en-us/sysinternals/strings.aspx, convert the dump file to text file.
In command promt,
system.exe chrome.DMP > output.txt
where chrome.DMP is your dump file.

4. Now use any text editor and search for your specific text in that output file using some keywords that you can remember typing in. I use Notepad++ - https://notepad-plus-plus.org/.

Note: Both the dump file and text file can be huge. Dump file willbe around 500mb to 1gb (but your mileage can vary) and the text file will around 100mb to 250mb.

5. Hurray you recovered your valuable content :) I am able to save couple of hours of my work using this method.






Copyright (c) 2008 - Suresh