places.sqlite Database Troubleshooting 编辑

This article describes troubleshooting actions to deal with a broken places.sqlite database.

How to (try to) recover from a corrupt places.sqlite

Sometimes after a Firefox/Aurora/Nightly upgrade, history disappears, but bookmarks are at their place. In the profile folder a places.sqlite-corrupt file has been created.

In some cases, this procedure may allow you to recover the corrupt file along with all of its contents (history).

Close Firefox and ensure it's done closing in your task manager.

Before you proceed, make a backup of the Firefox profile folder, in any case.

Create a folder to use temporarily for this work, such as my_work_folder.
Copy places.sqlite-corrupt from the Firefox profile folder to the work folder.

Download the latest precompiled binary Sqlite command-line shell from:
https://www.sqlite.org/download.html
Extract sqlite3 executable into the work folder.

Open a terminal window and navigate to the work folder.
Then open an sqlite shell:

my_work_folder> sqlite3 places.sqlite-corrupt

sqlite> PRAGMA integrity_check;

If the result IS OK, this guide won't help; stop here and please file a bug.

sqlite> .clone places.sqlite

sqlite> PRAGMA user_version;

Note the version number returned by the last pragma query.

sqlite> .exit

Open a new shell for the new database:

my_work_folder> sqlite3 places.sqlite

sqlite> PRAGMA integrity_check;

If the result IS NOT OK, the file cannot be recovered; stop here and please file a bug.

Let's fix the schema version.
NN must be replaced with the number we had noted previously:

sqlite> PRAGMA user_version = NN;

Let's update the page_size value:

sqlite> PRAGMA journal_mode = truncate;
sqlite> PRAGMA page_size = 32768;
sqlite> VACUUM;
sqlite> PRAGMA journal_mode = wal;
sqlite> .exit

Copy the new places.sqlite to the profile folder, overwriting the existing one.
Remove the places.sqlite-corrupt file.

Launch Firefox.

If the database is still broken (missing history, creating -corrupt file, ...), please file a bug.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:148 次

字数:3101

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文