Recover bookmarks from places.sqlite file

bookmarks, firefox, sqlite

Solution

The bookmarks are kept under your profile directory [1] (e.g. under Linux in a place similar to `~/.mozilla/firefox/rbbfa46q.default` or, in the snap version, in `~/snap/firefox/common/.mozilla/firefox/rbbfa46q.default`) stored in the file `places.sqlite`, an SQLite 3.x database. You can manage it as each SQLite database file.

Since it is possible to have conflict in the keys, at least in principle, I suggest to export as list of HTML links and import after in the second firefox account.

The following is a command actually able to create this list, as reported in another answer [2].

sqlite3 places.sqlite "select '<a href=''' || url || '''>' || moz_bookmarks.title || '</a><br/>' as ahref from moz_bookmarks left join moz_places on fk=moz_places.id where url<>'' and moz_bookmarks.title<>''" > t1.html

Then you can use the import method you find more cosy.

Note:

- Of course there are addon as "SQLite Manager" to manage it from inside Netscape...

Problem

I have a problem exporting my thousands of bookmarks in Firefox into a HTML file using the standard export function in Firefox. I get this error: ``` ************************* A coding exception was thrown and uncaught in a Task. Full message: TypeError: root is undefined Full stack: BookmarkExporter@resource://gre/modules/BookmarkHTMLUtils.jsm:980:1 BHU_exportToFile/<@resource://gre/modules/BookmarkHTMLUtils.jsm:228:22 TaskImpl_run@resource://gre/modules/Task.jsm:314:40 Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:865:23 this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:744:7 ************************* ``` see https://gist.github.com/rubo77/12ef9be4060c7935c74c Is there a way to export my bookmarks on the console, so I can import them into a new fresh firefox profile? UPDATE: I managed to copy and paste all bookmarks from the "manage bookmarks" menu of an instance of firefox with the old profile into another instance with the new profile opened at the same time (using the commandline option `-no-remote`). But unfortunately this still doesn't copy the tags that were used for my bookmarks, which would be a great loss too.

Original source

Related problems