Implement `backup` method for PlacesBackupResource
Categories
(Firefox :: Profile Backup, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox126 | --- | fixed |
People
(Reporter: mconley, Assigned: kpatenio)
References
Details
(Whiteboard: [fidefe-device-migration] )
Attachments
(1 file)
This bug is for implementing the backup
method on the PlacesBackupResource
. Along with copying the places.sqlite
and favicons.sqlite
databases.
As part of this step, the bookmarks from the Places database should be extracted to some importable format, like JSON or HTML, and placed into the staging folder.
Critically, if the user is configured to:
- Not remember history, or
- Clear history on exit
- Use permanent private browsing mode
Then neither places.sqlite or favicons.sqlite should be written to the staging folder.
Reporter | ||
Updated•7 months ago
|
Reporter | ||
Updated•7 months ago
|
Updated•7 months ago
|
Reporter | ||
Comment 1•6 months ago
|
||
For the two places.sqlite
and favicons.sqlite
databases here, we're going to want to use the backup
method exposed on Sqlite.sys.mjs
to do the copying: https://searchfox.org/mozilla-central/rev/529f04f4cd2ae68a0f729ba91cf8985edb23e9d3/toolkit/modules/Sqlite.sys.mjs#1998-2009
Reporter | ||
Comment 2•6 months ago
|
||
Critically, if the user is configured to:
Not remember history, or
Clear history on exit
Use permanent private browsing modeThen neither places.sqlite or favicons.sqlite should be written to the staging folder.
The other detail, however, is that bookmarks exist in the Places folder, and are still valuable to back up. What I think we should do is to generate a "bookmarks backup" representation (see PlacesBackup) within the backup
method, and include that in the staging folder. After this, check to see if the user fits any of the above conditions - and if so, return early. Otherwise, clone places.sqlite
and favicons.sqlite
into the staging folder.
During recovery, if we find a places.sqlite
and favicons.sqlite
in the recovery folder, we know that we can skip reading in the bookmarks backup file. Otherwise, we'll attempt to import the bookmarks backup file into a newly created places.sqlite
after the recovered profile is launched.
Updated•6 months ago
|
Reporter | ||
Comment 4•6 months ago
|
||
To expand a bit on comment 2, I think it's perfectly reasonable to use BookmarkJSONUtils.exportToFile(aFilePath);
to create the bookmarks backup in the event that the Places database as a whole isn't being backed up.
Reporter | ||
Comment 5•6 months ago
|
||
(We'll definitely want an automated test for that case)
Comment 7•6 months ago
|
||
bugherder |
Description
•