How can I restore Mozilla Firefox crashed session from "sessionrestore-backups" .jsonlz4 file?

My Firefox (Quantum v.66 on Windows 10) crashed, and I accidentally clicked "Start New Session" instead of "Restore Session", which lost all of my previous tabs.

Good news: In my profile, in "sessionstore-backups" folder, I found a large file called previous.jsonlz4, which SEEMS like it contains all of my previous tabs and windows.

I confirmed that it's a valid file using Session History Scrounger for Firefox tool that seemed to be the only useful resource my Googling turned up on the topic.

Bad news: After a couple of days of Googling, I can't seem to figure out how to restore the data from jsonlz4 file to my browser's tabs (basically, turn it back into crash session restore).

How can I do that?

What I tried:

  • Copied that jsonlz4 into "sessionrestore-backups" directory as "recovery.jsonlz4" - which seems to be the file that gets updated when FF crashes as per my experiments. This had no effect.

  • Copied the JS file that Scrounger created for me into previous.js and recovery.js. No effect.

  • Deleted "store.json.mozlz4" file in "crashes" subdirectory in my profile. No effect.

Notes:

  • Note: I am NOT looking for random ways to get a list of URLs from the JS file that Scrounger created. I know how to do that. I want to actually import my crashed session into crash session recovery in FireFox, or into active Firefox session.

  • Note: I'm aware of this similar question but it asks about pre-version-57 session format circa 2012, which seems to have nothing to do with modern post-version-57 session mechanism.


Solution 1:

In the sessionstore-backups folder, identify which file you want to restore from. Just in case, the full path to get there is:

C:\Users\[your user name]\AppData\Roaming\Mozilla\Firefox\Profiles\[profile name]\sessionstore-backups

Use the Session History Scrounger for Firefox to decide which of the available files to use. I'm pretty sure you can use any of the following:

previous.jsonlz4
recovery.baklz4
recovery.jsonlz4

I can vouch that I myself recently used recovery.baklz4 from a backup of my whole HDD when FF randomly lost all my windows and tabs after a Windows crash and FF update.

Then, go to your main profile folder--that means, go UP one step in the directory "tree." Paste your chosen file into this folder and rename it to sessionstore.jsonlz4. This should be done with FF closed, and there should already be such a file there. So do something with it--delete it, rename it, whatever--but it needs to be replaced by the file you are using to recover from. (If you do this while FF is still open, I believe it will simply overwrite it with a new file once you close it, and you will be back where you started.)

Then, open FF, and it will use the newly created sessionstore.jsonlz4 to open all the windows and tabs.

Source: https://support.mozilla.org/en-US/questions/1221836


However, if you just opened FF and realized your session was reset, you should NOT close it. First copy/paste all files in sessionstore-backups folder somewhere else and hopefully at least one of them will have your old session info.

Source: https://support.mozilla.org/en-US/questions/1204253


I don't understand why this Jefferson person didn't simply write out these instructions on his scrounging website--would've saved everyone (including me) a lot of time!

Solution 2:

For those (like me) who have very large *.jsonlz4 files (mine was 55MB), the Scrounger https://www.jeffersonscher.com/ffu/scrounger.html actually crashes when we upload the file, so it's useless. I created a script to extract the URLs from these large files: https://github.com/matthieuheitz/recover-firefox-session Hope it helps someone!