how to restore Firefox not the last "Restore Previous Session" pages

Viewed 11171

I would like to restore not the last "Restore Previous Session".

  1. Open firefox (v78.0) with few tabs: aaa.com, bbb.com.
  2. Close Firefox.
  3. Open Firefox, open few tabs, ccc.com, ddd.com.
  4. Close Firefox.
  5. Open Firefox. How to get those tabs aaa.com, bbb.com from "Restore Previous Session"?
4 Answers

I went to the address bar of Firefox, typed about:support and saw which is the profile folder of Firefox.

I figured out that some versions of Firefox create a c:\Users\MY_USER\AppData\Roaming\Mozilla\Firefox\Profiles\j1hcxbyk.default-release\sessionstore.jsonlz4 file when Firefox is closed.

I also found a copy of a session file c:\Users\MY_USER\AppData\Roaming\Mozilla\Firefox\Profiles\j1hcxbyk.default-release\sessionstore-backups\upgrade.jsonlz4-20200630195452

So, I:

  1. stopped Firefox,
  2. made a back-up copy of the profile folder,
  3. replaced sessionstore.jsonlz4 (or copied there if that file didn't exist) with upgrade.jsonlz4-20200630195452,
  4. started Firefox,
  5. restored the previous session with: Menu->History->Restore Previous Session,
  6. checked that the old session, with my tabs, was restored.

Note: I chose upgrade.jsonlz4-20200630195452 because it was created in the same day, when I closed Firefox with all my tabs.

Recently, I faced the same issue of missing tabs when I restored the correct system date from some earlier date. After scouring the internet, I got the following tip to restore the firefox tabs back from saved sessions. My PC runs Microsoft Windows 10 Home with Firefox version 91.0.

Reference: https://support.mozilla.org/en-US/questions/1314940 "At startup, Firefox usually will look first for sessionstore.jsonlz4 at the main level of your profile folder and if it finds it, use its contents to create recovery.jsonlz4 -- if you restore automatically -- or previous.jsonlz4 -- if you do not restore automatically. So you could try replacing that file if you haven't already (as well as recovery.jsonlz4)".

  1. Close the firefox browser.
  2. Open %AppData%/Mozilla/Firefox/Profiles folder
  3. Select the latest folder that contains .default in it.
  4. Open sessionstore-backups folder. Now your path would be something like %AppData%\Mozilla\Firefox\Profiles\13dn9aq1.default-1473265690957-1560267471460\sessionstore-backups
  5. Locate files with upgrade.jsonlz4- prefix and select the one which you think probably would contain your tabs.
  6. Keep the original one untouched. Create a copy of it and rename it to sessionstore.jsonlz4
  7. Copy the sessionstore.jsonlz4 file. Locate the sessionstore.jsonlz4 file in the folder one level down: %AppData%\Mozilla\Firefox\Profiles\13dn9aq1.default-1473265690957-1560267471460\ and replace it with the sessionstore.jsonlz4 file just copied.
  8. Now you can open Firefox and you will get all your old tabs from the restored session.

The folder .default. can be located as follows also,

  • Type "about:profiles" in firefox and press enter
  • Click "Open Folder " next to Root Directory path

Recent Firefox version (version 96 this time, or at least the Linux one) doesn't have sessionstore.jsonlz4 in the root of the profile, so the other advices does not seem to work.

Firefox nightly upgrades a lot, so I have a very good chance to have FF restarted and lose all the session with no "restore session" available at all.

The solution (for me at least) was

  • stop Firefox
  • go to session backup directory at ~/.mozilla/firefox/<session_name>/sessionstore-backups/
  • copy any old file over recovery.jsonlz4 (say, cp upgrade.jsonlz4-20211112213406 upgrade.jsonlz4-20211112213406)
  • start firefox, and let it automagically restore th old session

It seems firefox only stores only the last previous.jsonlz4 there apart from upgrades, so it may be useful to ask cron to make periodical backups of recovery.jsonlz4 or similar.

Related