How to recover data from Safari Sessions extension after clearing history

safarisafari-extensions

I use Sessions to keep track of browsing sessions in Safari. I was having some trouble with invalid cookies and I cleared my web history. Now all of my saved Sessions are gone. Is there any way to recover the data? Where does Sessions store it's data? I may have a backup.

Best Answer

If you go to Sessions "Help" (in the gear menu), there are two questions relevant to your issue:

Why did my saved sessions disappear when I reset Safari or cleared its history?

The option to remove website data, available when either resetting Safari or clearing its history, will delete extension data without warning. Some third-party cache cleaners may do the same. It is recommended to take care when using these tools, as any data so deleted can only be recovered from a backup.

and more importantly for you:

How do I recover Sessions data from a Time Machine or other backup?

If you are familiar with the command line, try using the sessions-export script. This is the recommended procedure. Alternatively, it is possible to physically replace the database file with a backup. The .db file under the directory ~/Library/Safari/Databases/safari-extension_yoo.david.sessions-deub45nr9t_0/ can be replaced by a recovered file if the latter is renamed to match the file it replaces.

So, if you have a backup, it should be as easy as a copy and maybe a rename.