What can I use to save/restore Safari's history?

Safari history is stored in an SQLite database located at

~/Library/Safari/History.db

You can copy this file elsewhere to save it, then restore it by copying it over the top of the existing file (while Safari is quit).


I use a Safari extension name Sessions. The code is available on GitHub here. This will only work on Safari version less than 12. Apple has deprecated Safari Extensions in v12.

Sessions keeps track of your open windows and tabs for you. With the click of a button you can save a snapshot of your session at any time and start fresh, secure in the knowledge that you can return to your tabs at your future leisure.

Sessions is efficient, lightweight, and gets out of your way; with automatic backups enabled, you do not have to think about it until you need it. Every aspect of its design has been carefully considered and infused with familiar Mac sensibilities. And with Sessions's rich tab management and searching abilities, losing a link may be a thing of the past.

enter image description here

I can go back several days thru my browser tab history and even delete old sessions I no longer need. It does all of this in the background so I don't have to do anything.