Starting in Firefox 3, bookmarks and browsing history are stored in the places.sqlite file, located in the Firefox profile folder. On a Windows 7 system, the file will be in a directory similar to
C:\Users\AcctName\AppData\Roaming\Mozilla\Firefox\Profiles\q3wdrb9w.default
. AcctName will be the name for the particular account.
The \q3wdrb9w.default
is a specific example; you would see a
sequence of 8 numbers and letters that is unique to a particular profile on
that system followed by .default
. Note: you will have to turn on
the display of hidden files and folders to see the directory (see
Show hidden files for instructions on how to do this for
Windows 7).
Places.sqlite is used in Firefox 3 instead of the older bookmarks.html and history.dat files (the older files are left in the profile folder for backward compatibility).
I opened a places.sqlite
file with
SQLite. Note: Firefox must be closed
when you try opening the file or you will get the error message "Error:
database is locked".
C:\Users\Administrator\Downloads>sqlite3 C:\Users\Administrator\AppData\Roaming\ Mozilla\Firefox\Profiles\q3wdrb9w.default\places.sqlite SQLite version 3.6.23 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite>
I then used .tables
to see what tables were in it.
sqlite> .tables moz_anno_attributes moz_favicons moz_keywords moz_annos moz_historyvisits moz_places moz_bookmarks moz_inputhistory moz_bookmarks_roots moz_items_annos
The places.sqlite file contains the following tables:
- moz_anno_attributes - Annotation Attributes
- moz_annos - Annotations
- moz_bookmarks - Bookmarks
- moz_bookmarks_roots - Bookmark roots i.e. places, menu, toolbar, tags, unfiled
- moz_favicons - Favourite icons - including URL of icon
- moz_historyvisits - A history of the number of times a site has been visited
- moz_inputhistory - A history of URLS typed by the user
- moz_items_annos - Item annotations
- moz_keywords - Keywords
- moz_places - Places/Sites visited - referenced by moz_historyvisits
You can see what the columns are in a table using the .schema
command, so I can use .schema moz_bookmarks
for further information
about the "bookmarks" table.
sqlite> .schema moz_bookmarks CREATE TABLE moz_bookmarks ( id INTEGER PRIMARY KEY, type INTEGER, fk INTEGER D EFAULT NULL, parent INTEGER, position INTEGER, title LONGVARCHAR, keyword_id INT EGER, folder_type TEXT, dateAdded INTEGER, lastModified INTEGER); CREATE INDEX moz_bookmarks_itemindex ON moz_bookmarks (fk, type); CREATE INDEX moz_bookmarks_itemlastmodifiedindex ON moz_bookmarks (fk, lastModif ied); CREATE INDEX moz_bookmarks_parentindex ON moz_bookmarks (parent, position); CREATE TRIGGER moz_bookmarks_beforedelete_v1_trigger BEFORE DELETE ON moz_bookma rks FOR EACH ROW WHEN OLD.keyword_id NOT NULL BEGIN DELETE FROM moz_keywords WHE RE id = OLD.keyword_id AND NOT EXISTS ( SELECT id FROM moz_bookmarks WHERE keywo rd_id = OLD.keyword_id AND id <> OLD.id LIMIT 1 );END;
A diagram of the layout of the tables provides further information as does the The Places database.
I can see that there is a column named "title". So I can view the value for
"title" for all entries in the table with select title from
moz_bookmarks
. Note: you may see a lot of what may appear to be
extraneous bookmarks, i.e. webpages not bookmarked by the user. That's because
you also see what you would see if you clicked on Bookmarks,
Bookmarks Toolbar, Latest Headlines.
You can exit from sqlite with .exit
, .quit
,
or Ctrl-C
.
If you prefer a GUI to browse SQLite databases, you can use SQLite Database Browser, which can provide a graphical interface for browsing the databases on a Windows system.
To install the program, just unzip the files in the .zip file, once you've downloaded it, to the directory you want to use for it.
References: