Firefox won't export bookmarks to HTML or JSON




3 years ago
5 months ago


(Reporter: bmo, Unassigned)


Firefox Tracking Flags

(Not tracked)




3 years ago
somehow, i guess my places.sqlite got in a state where it can no longer be exported.  i've read and tried safe mode and restoring to a bookmark backup that shows hundreds of entries in the menu and i still can't export.

i'm happy to provide the sqlite file in private to a developer for diagnosis.

Comment 2

3 years ago
thanks for the pointer.

n installed the Places Maintenance add-on and after a passing integrity check and coherence check, i took the plunge and executed the All preset:
> Integrity check
+ The database is sane
> Reindex
+ The database has been reindexed
> Orphans expiration
+ Database cleaned up
> Coherence check
+ The database is coherent
> Vacuum
Initial database size is 40960 KiB
+ The database has been vacuumed
Final database size is 40960 KiB
> Statistics
Database size is 40960 KiB
user_version is 30
page_size is 1024
cache_size is -2048
journal_mode is wal
synchronous is 1
History can store a maximum of 104858 unique pages
Table moz_bookmarks has 681 records
Table moz_bookmarks_roots has 5 records
Table moz_keywords has 136 records
Table sqlite_sequence has 1 records
Table moz_favicons has 3454 records
Table moz_annos has 1240 records
Table moz_anno_attributes has 14 records
Table moz_items_annos has 63 records
Table moz_historyvisits has 81607 records
Table moz_dummy_table has 1 records
Table moz_places has 55581 records
Table moz_inputhistory has 147 records
Table sqlite_stat1 has 14 records
Table moz_hosts has 4057 records
Index sqlite_autoindex_moz_bookmarks_roots_1
Index sqlite_autoindex_moz_keywords_1
Index sqlite_autoindex_moz_favicons_1
Index sqlite_autoindex_moz_anno_attributes_1
Index sqlite_autoindex_moz_inputhistory_1
Index sqlite_autoindex_moz_hosts_1
Index moz_bookmarks_itemindex
Index moz_bookmarks_parentindex
Index moz_annos_place_idindex
Index moz_historyvisits_fromindex
Index moz_historyvisits_placedateindex
Index moz_places_faviconindex
Index moz_places_hostindex
Index moz_places_visitcount
Index moz_places_frecencyindex
Index moz_bookmarks_itemlastmodifiedindex
Index moz_places_lastvisitdateindex
Index moz_places_url_uniqueindex
Index moz_annos_placeattributeindex
Index moz_items_annos_itemattributeindex
Index moz_bookmarks_guid_uniqueindex
Index moz_places_guid_uniqueindex
Index moz_keywords_placepostdata_uniqueindex

Fx still won't create a bookmarks.html file when i request it to.
Summary: Firewox won't export bookmarks to HTML or JSON → Firefox won't export bookmarks to HTML or JSON
so, how did you try to export and how did you figure it's not working?
During export do you see any errors reported to the Browser Console?

Comment 4

3 years ago
from Library window that pops up when i click Bookmarks -> Show All Bookmarks:
Import/Export button -> Export Bookmarks to HTML... -> Save
no file is created

also, the .json file created by the Backup option is only 2KB and appears to just be a stub file with none of my bookmarks.

the only thing that i see added to the Browser Console when attempt do the HTML export is:
this._root is undefined
did you ever run SQL queries on places.sqlite or installed some add-on that could have interacted with bookmarks?
Sounds like your database has a completely broken bookmarks table, the this._root error points out it cannot find the bookmarks menu root...

If you don't mind, I'd appreciate to get a copy of your places.sqlite file through private mail for debugging. If it's large you can upload a compressed and password protected versions somewhere in the cloud.
Also, I hope you have some valid bookmarks json backups in the profile (the Library should report number of bookmarks and size for each backup). If so you could just throw away (but first save it for debugging the problem) places.sqlite and then restore from a backup to have a working profile (sorry, history will be lost in the process).

Comment 7

3 years ago
i never manually ran SQL queries on places.sqlite.  to my knowledge, the only add-on i have installed that would have interacted with bookmarks is your Places Maintenance one.

my profile is mostly working.  i can see all the bookmarks i expect to see in the Library and they work.  the only problems i've noticed are the export failure and my inability to update the keyword on a particular bookmark (which is what led me down this rabbit hole).

i already restored an older version of my bookmarks from the Library, but that didn't help with the above.  i think the corruption is longstanding.

Comment 8

3 years ago
i just emailed you a zip'd copy of my places.sqlite
ah the keyword issue is bug 1150678.
I wonder if it's related, it may be.
There is something very strange in your database:

"4","2",,"2","3","Personal Toolbar Folder",,"toolbar","1191877844781000","1436808008593000","Pv3_tKDXZLuF"

There is also another folder having a folder_type... folder_type is a column we don't use anymore from at least Firefox 3 alpha... It's like this file traveled in time from from Firefox 3 alpha to the current version.

Btw, the actual problem is that for whatever reason the Bookmarks Menu and Tags root have the wrong parent and position.
These queries should fix the situation enough that you can export to a JSON backup. Then I'd suggest to throw away places.sqlite, and reimport the json backup into the new one. That will lose history but this db is too broken to rely on it...

UPDATE moz_bookmarks SET parent = 1 WHERE guid="menu________";
UPDATE moz_bookmarks SET parent = 1 WHERE guid="tags________";

I'll leave this bug open cause it may be worth to add fixing roots parent to Places Maintenance. I actually thought it was already doing that, but looks like we do that only if the main root is missing.
Priority: -- → P3

Comment 11

3 years ago
i did the two queries and was able to successfully export a JSON backup from the Library :)  thanks!

i deleted places.sqlite from my profile directory and restarted Firefox with the intention of doing a fresh restore from the JSON backup, but it looks like it did that automagically.  i guess it imported from the copy it apparently put in bookmarkbackups.
In 61 we fixed roots in Places Maintenance, in 62 we did it on startup. So I believe this is fixed now according to the details in comment 10.

Bug 1472241 was the last one that touched this, so I'll dupe there.
Last Resolved: 5 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1472241
You need to log in before you can comment on or make changes to this bug.