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

5,342

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!

Share:
5,342

Related videos on Youtube

DVK
Author by

DVK

Areas of expertise: Perl expert (specifically enterprise software development Sybase (table design, query optimization and stored proc development) Java (including Reflection and Javascript embedding) Areas of familiarity: Web programming (EmbPerl, JSP, CSS, HTML, JavaScript) C++ Shell scripting, *nix system administration

Updated on September 18, 2022

Comments

  • DVK
    DVK almost 2 years

    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.

  • StormRyder
    StormRyder almost 4 years
    What in the world does this mean: "move previous.jsonlz4 to recovery.jsonlz4"???? Those are files, not directories. How can you move a file to a another file? Wut?
  • user66001
    user66001 over 3 years
    Move is what actually happens behind the scenes when you rename files. On Linux/Unix systems, you actually use mv to rename files. In Windows the rename command is a synonym for moving.
  • facehugger
    facehugger over 2 years
    Please tell me, do you have any difficulties with such a big storage? Mine is 10.2 MB (1 window, 4500+ tabs, ~90 containers) and I've found that my firefox lags heavily when the size of sessionstore.jsonlz4 increases more than 10.3 MB
  • matthieu
    matthieu over 2 years
    I didn't have too much problems, although maybe it depends on the size of your ram?
  • matthieu
    matthieu over 2 years
    I honestly don't know how it happened that this file got as big as 55MB, because now when I check, on my desktop or my laptop, the files are 1MB and 1.8MB, and I have a good hundred tabs opened.