问题
I have two files that I managed to restore from a Firefox installation under Windows XP. The first one is urlclassifier3.sqlite and the second one is urlclassifier.pset.
I understand that those files contain the actual bookmarks for an installation of Firefox, under a user profile, given that the profile is .\Mozilla\Firefox\Profiles\akcum27.default. How can I restore the bookmarks from those files?
The big one is the .sqlite file, at around 56 kilobytes.
回答1:
Bookmarks are held in file places.sqlite
, not urlclassifier. You can try to replace the file in your current installation with that. Make sure Firefox is closed. If that doesn't work:
You might want to install the Firefox addon "SQLite Manager" and then use the addon (use the Alt key to open the addon menu in Firefox) to open the file places.sqlite from your old install. Right click Tables -> moz_bookmarke on the left hand side and click "export table"
Export your table as XML or SQL and then open file places.sqlite from your current install and click Database -> Import Table and import it in the similiar same way you exported.
回答2:
A query that will actually work (on Windows as the question is about) is:
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
This presumes:
- Using the Windows command-line (CMD)
- The current directory is where
places.sqlite
is - SQLite 3 (executable
sqlite3
) is installed and is in the path (environment variablePATH
)
Sample generated HTML:
<a href='http://www.wunderground.com/hurricane/'>Tropical weather</a><br/>
<a href='http://www.dmi.dk/vejr/maalinger/radar-nedboer/'>DMI, Radar</a><br/>
<a href='http://www.skyandtelescope.com/observing/objects/planets/3304091.html?page=1&c=y'>Transit Times of Jupiter's Great Red Spot - Planets - SkyandTelescope.com</a><br/>
<a href='https://www.quora.com/What-is-the-most-misspelt-word-in-the-English-language'>(951/25) What is the most misspelt word in the English language? - Quora</a><br/>
<a href='http://www.eevblog.com/2015/06/16/eevblog-754-altium-circuit-maker-first-impressions/'>EEVblog #754 - Altium Circuit Maker First Impressions | EEVblog - The Electronics Engineering Video Blog</a><br/>
<a href='https://www.arduino.cc/en/Main/ArduinoBoardUno'>Arduino - ArduinoBoardUno</a><br/>
回答3:
You can also replace the places.sqlite
file in the Firefox profile folder, and then, since the database may not be retrieved by Firefox, you can open another web browser (Chrome, Edge, etc.) and import your Firefox bookmarks from this new browser (most of the browsers can import Firefox bookmarks). Finally, from Firefox you can import the bookmarks again from this third-party web browser.
回答4:
A quick-and-dirty solution is:
dalem@QnD:~/Downloads$ 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
来源:https://stackoverflow.com/questions/11769524/how-can-i-restore-firefox-bookmark-files-from-sqlite-files