Today a bug in Safari closed nearly all of my tabs and they were not in the history of last closed tabs. A precondition of this solution is having iCloud Tabs enabled.
⇧+⌘+G) in Finder to the following folder:
Open Time Machine, change the date time to the last time, when the tabs were existent and copy the file
CloudTabs.db and paste it in Finder into a new project directory.
Open the Terminal and
cd to the project directory.
$ cd <e.g Documents/recover-tabs>
Open the database:
$ sqlite3 sqlite> .open CloudTabs.db
Get the device UUID:
SELECT device_uuid, device_name FROM cloud_tab_devices;
In this case the device UUID would be
To get a list of URLs just use the following statement:
SELECT url FROM cloud_tabs WHERE device_uuid = '<device UUID>';
If you want the page titles, use the following statement:
SELECT title, url FROM cloud_tabs WHERE device_uuid = '<device UUID>';
Now just copy the list into a file.