為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Why does saving bookmarks to json and then restoring the backup wipe all bookmarks?

  • 4 回覆
  • 7 有這個問題
  • 23 次檢視
  • 最近回覆由 zumbs

more options

Earlier today X-marks started acting up, so I backed up my bookmarks (to json as it is the default for Firefox). Then I started cleaning up to get X-marks into a good state, but only ended up with a messed up list of bookmarks. No problem, I disabled X-marks and restored my backed up bookmarks. That gave the dreaded "unable to process the backup file" error, and I tried all the steps to fix it. Deleting the places.sqlite, uninstalling and reinstalling firefox did not help (I deleted my profile before reinstalling).

In the end, I used https://github.com/andreax79/json2html-bookmarks to convert the backed up json file to html, which yielded a html file that Firefox could import. So, I tried to save the bookmarks to a json file again and then restore from that ... which caused the same "unable to process the backup file" error, wiping my bookmarks again.

I still have the html file, so I can just import that, but why on Earth is Firefox using json for backing up bookmarks if it is broken?

If it is a bug, where do I report it?

Earlier today X-marks started acting up, so I backed up my bookmarks (to json as it is the default for Firefox). Then I started cleaning up to get X-marks into a good state, but only ended up with a messed up list of bookmarks. No problem, I disabled X-marks and restored my backed up bookmarks. That gave the dreaded "unable to process the backup file" error, and I tried all the steps to fix it. Deleting the places.sqlite, uninstalling and reinstalling firefox did not help (I deleted my profile before reinstalling). In the end, I used https://github.com/andreax79/json2html-bookmarks to convert the backed up json file to html, which yielded a html file that Firefox could import. So, I tried to save the bookmarks to a json file again and then restore from that ... which caused the same "unable to process the backup file" error, wiping my bookmarks again. I still have the html file, so I can just import that, but why on Earth is Firefox using json for backing up bookmarks if it is broken? If it is a bug, where do I report it?

所有回覆 (4)

more options

You might already have done more research on this problem that most support volunteers.

Since the Python script worked, I assume the JSON output by the backup function was valid. (Small victory!)

The Restore feature may be sensitive to the file extension, so I definitely would stick with .json and not get creative.

My guess for what might have gone wrong as Firefox consumed the JSON is either (A) problem with the JSON parser or (B) in writing the values to the places.sqlite database some unanticipated problem arose based on the data itself (which is odd, because this data came from Firefox, but maybe its funkiness is related to why bookmarks were misbehaving before).

To search existing bugs or file new ones: https://bugzilla.mozilla.org/

more options

When importing from a JSON file, the current data is replaced. If import an HTML file, this is added to the current data.

more options

It sound that the JSON backup you created is corrupted because at the time you created this backup places.sqlite was already corrupted.

Do you have compressed .jsonlz4 files in the bookmarkbackups folder that you can try to restore?

The name of an automatically created JSON bookmarks backup in the bookmarkbackups folder includes a total item count (folders and separators included) and an hash value to prevent saving the same backup more than once.

  • bookmarks-YYYY-MM-DD_<item count>_<hash>.jsonlz4.
more options

@cor-el: You may be misunderstanding me.

I reinstalled Firefox, so the profile and all bookmarks were wiped. (I deleted the profile manually after uninstalling, just to be sure.)

Then I used the script mentioned above to export the json file to html and imported the html file.

If I export my current bookmarks to json and then try to import the newly exported bookmarks, I end up with no bookmarks. With a clean installation, the places.sqliete file should be in a good state?

I backed up my profile before deleting it, and while there are many jsonls4 files in it, none of them are called anything with bookmarks. Most of them are in the datareporting folder.