Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Trying to restore old Safari session and recover lost tabs/windows with Time Machine

I am running Big Sur 11.6 on a 2016 MacBook Pro. I had a rather large number of tabs in multiple windows open in Safari representing a lot of research effort. Periodically, I would need to restart computer and tabs would all reopen. Occasionally, when I would inadvertently close a window full of tabs or shut down Safari, I could utilize 'Recently Closed', 'Reopen Last Closed Tab', or 'Reopen All Windows From Last Session' commands to recover. Unfortunately I did not have the sense to 'Add Bookmarks For These Tabs', and after an unexpected shutdown of Safari yesterday, I inadvertently opened and closed Safari before using 'Reopen All Windows From Last Session'. Now I cannot recover all those tabs. I have recent Time Machine backups and tried the frequently suggested strategy of restoring a recent version of ~/Library/Safari/LastSession.plist from Time Machine, but when I close Safari and then do this and restart Safari, the 'Reopen All Windows From Last Session' command is greyed out and not available. I have tried this a few times, even restarting computer before reopening Safari, and even trying to restore entire '~/Library/Safari/' folder to no avail. Interestingly, all of the Time Machine versions of LastSession.plist file from the last few weeks all say last modified Sept. 20, 2021, implying that the file hasn't been modified since then, although that is still fine for my needs. I have a copy of one of these recent versions of LastSession.plist from Time Machine on my desktop, and using the advice in the thread https://discussions.apple.com/thread/252894091?login=true

tried to run a script developed by community member 6x6 to generate a Bookmark file from which I could reopen all my old tabs, but running the script fails to produce a functioning bookmark file. I can open the plist file with TextEdit and can see some of the URLs I need to retrieve but its a massive chaotic file and not sure I can get everything I need in a reasonable time.


Just don't get why restoring LastSession.plist is not allowing me to 'Reopen All Windows From Last Session'. Any help on resolving this problem would be appreciated.




MacBook Pro 15″, macOS 11.6

Posted on Oct 7, 2021 1:54 PM

Reply

Similar questions

6 replies
Sort By: 

Oct 28, 2021 8:16 AM in response to Lahmy88

It was a pre safari 15 session that I lost after upgrade to 15. The original thread where I learned about the safaritab files actually only mentioned 3 files, but I replaced all 4 out of laziness. It seemed to work after a few tries, although there was still some wonkiness with most tabs being restored but not all if I quit Safari and then restarted. Eventually, the magic was restoring the 4 safaritab files, starting safari, waiting some time to make sure everything synced again (overnight), and then restarting computer. All tabs were present and accounted for and have been working fine. Unfortunately I’m having so many other issues, I’m getting close to doing a clean reinstall on my 2016 MacBook Pro.

Reply

Dec 5, 2021 10:29 AM in response to Msc7291

It worked for me! Thanks @Msc7291


Important:


1. Before restoring close Safari.


2. When in finder here ~/Users/[user name]/Library/Containers/com.apple.Safari/Data/Library/Safari

This folder may be hidden: com.apple.Safari


3. Folder from the restored directory (saved to downloads) appeared simply as "Safari". Renamed to the correct folder there (which retrospectively probably didn't need to do), and when dropped it in Containers directory was prompted, even though the file was hidden, it was recognized as "Safari" folder.


4. In this case replaced the entire folder, and was promoted to merge or overwrite newer "Safari" folder (actually com.apple.Safari). Select overwrite.


5. Wait few moments then open Safari browser and go to next step (don't do a thing yet in browser and don't panic!).


6. Go to History menu and select: Reopen All Windows from Last Session.


7. Previously open tabs repopulate.

Reply

Dec 5, 2021 11:17 AM in response to idenizen

Ah . . . when I restarted we were back to same old problem! When I used Reopen All windows from Last Session it didn't do a thing! So, new steps:


8. Go to Bookmarks menu and Add Bookmarks for These xx Tabs.


9. Export bookmarks.


If the problem happens after restart, import the bookmarks wanted. That should help you survive whatever Apple is up to.





Reply

Oct 7, 2021 3:14 PM in response to Msc7291

I found some additional information that solved my problem in the following thread: https://www.reddit.com/r/Safari/comments/pvcz1v/safari_15_and_lastsessionplist/heb0yre/.


Apparently in Safari 15, Lastsession.plist is no longer where the action is. By navigating to ~/Users/[user name]/Library/Containers/com.apple.Safari/Data/Library/Safari, there are four files that start with "SafariTabs" that I restored. I then reopened Safari and was finally able to 'Reopen All Windows From Last Session'. Hopefully this information will help others in same situation. And yes, I just 'Add Bookmarks For These Tabs' so I don't have t go through this silliness again.

Reply

Oct 10, 2021 5:51 PM in response to Msc7291

I had trouble with an iMac running Catalina (10.15) and it wouldn't apply system updates for months (restart confirmation countdown wouldn't actually restart and would continuously fail/timeout) before finally it did which then restarted with Safari 15.0 installed and now all my tabs are gone too!


I of course tried 'Reopen All Windows from Last Session' when Safari 15.0 first launched as I didn't have my previous session but that didn't work and so went to do the usual Time Machine ~/Library/Safari/LastSession.plist method that @Msc7291 describes which I become VERY used to over the years lol but to no avail :(

Reply

Oct 10, 2021 5:57 PM in response to Msc7291

Can you please confirm if this only worked after you had a new session in Safari 15 and can restore any previous Safari 15 session because I restored the 3 files "SafariTab.db", "SafariTab.db-shm" and "SafariTab.db-wal" but didn't restore "SafariTabsSyncMetadata.plist" because although you specified 4 files that start with "SafariTabs", I assumed that SyncMetadata one not to do just because I wasn't sure.


Basically I need to try and recover a pre-Safari 15.0 session into Safari 15.0 or how do I downgrade Safari and get my old session back - any ideas?

Reply

Trying to restore old Safari session and recover lost tabs/windows with Time Machine

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.