Jan 20

Restoring lost Safari tabs

Recently I’d been having hardware issues with my Mac which resulted in quite a few hard shutdowns for the machine. Once I got up and running I found to my surprise that I’d managed to lose all of my Safari windows and tabs of which I had in abundance. This was rather distressing as I have far too much research on topics open at any given time for anything from stream processing systems to certificate authorities to research on containerisation to creating grids in AngularJS. Suffice to say I wasn’t excited at the prospect of losing that information.

A quick Google search gave me a bit of hope. There was an article on Mac OS X hints about “Safari loses all your open tabs: recover using Time Machine“. It suggests using a tab backup extension but failing that you can recover it from Time Machine. I have Time Machine backups so this one was easy.

The steps to get this sorted were:

  • Stop Safari.
  • Connect to Time Machine backup.
  • Look for ~/Library/Safari/LastSession.plist in the Time Machine backup (if you press “SHIFT+APPLE+G” and then paste that address, Finder will take you directly to the file).
  • Restart Safari and go “History” -> “Reopen All Windows From Last Session”

Once I did that all of my windows and tabs were restored! As an aside I got curious to see what was in the file and if you are curious too there are a few ways to open up a plist file like this one.

7 comments

7 Comments so far

  1. Umuarama September 10th, 2015 9:06 pm

    This was the best and simplest way to do it I have seen yet.
    This issue has occurred with me other times and I will definately bookmark this page! GREAT!

  2. Robert February 5th, 2016 9:53 am

    This method used to work but doesn’t anymore. Although the safari folder still has a lastsession.plist file, restoring it from time machine, or restoring anything else in that folder, will no longer bring back your windows and tabs. For that, you’d have to restore the com.apple.Safari.savedState folder, and time machine doesn’t back that up, so, now, in order to restore lost safari tabs, you have to first figure out a way to get time machine to back up that folder (which I don’t know how to do), unless you want to periodically back up the folder manually.

  3. pasamio February 18th, 2016 5:08 pm

    I recently went through this process again recently (on El Capitan) and it won’t automatically restore anything unless you go through the final step of “History” -> “Reopen All Windows From Last Session” manually.

  4. Umuarama April 15th, 2016 8:55 pm

    I can confirm it still works on El Capitan! Like pasamio pointed out, you have to select reopen all windows from last session. This tip is gold for me. It has saved several times! Thanks.

  5. basil August 30th, 2016 7:56 pm

    That trick works on Mavericks too. This is a great tip. I love it. Thanks !

  6. Leman January 11th, 2017 2:00 am

    I succeeded it also ! The trick is you need to click on the lastsession.plist file and when it´s open on the screen you need to reopen all windows from last session. Thanks for the tip …

  7. Alan May 12th, 2017 3:58 pm

    I thought the solution would be something like this, but I couldn’t get it to work until I followed your instructions. Thanks for saving my ass! (Well, my 50 or so tabs, anyway.) 🙂

Leave a comment

%d bloggers like this: