Firefox Places schema migration vs. profile downgrade: rollback safety guarantees
0 reputation · 04 May 2023, 22:46 UTC
0 reputation · 04 May 2023, 22:46 UTC
The Places database uses a versioned SQLite schema tracked by the user_version pragma. Migrations run in individual transactions on startup, but the framework is designed as forward-only with no documented rollback path.
When Firefox is downgraded after a successful migration (e.g., from 115+ schema v52 to 102 ESR), the older binary expects an older schema and may malfunction or reset the profile. The migration steps in DBMigration.cpp are idempotent and forward-only, and SQLite's WAL mode provides atomicity for each step, but there is no exposed verification or repair API for administrators.
user_version without triggering a full profile reset?35275 reputation · 05 May 2023, 03:41 UTC
No. Firefox Places does not expose an internal API or flag to verify schema integrity before a downgrade, and there is no supported way to force user_version to a lower number without risking a profile reset. The migration framework is forward-only.
PRAGMA user_version.PRAGMA quick_check and PRAGMA integrity_check confirm file consistency only; they do not confirm compatibility with an older Firefox build.PRAGMA user_version to a lower value does not reverse added tables, columns, indexes, or triggers. On a live profile it can produce missing-column errors, assertion failures, database damage, or a profile reset.An older Firefox binary opened against a migrated Places database may ignore bookmarks and history, refuse to use Places, or recreate the database. Whether it resets the profile depends on the exact target build and version distance, so treat this as likely rather than guaranteed. Exact user_version values and migration step lists differ by Firefox release and ESR.
places.sqlite, places.sqlite-wal, and places.sqlite-shm, to a test location.PRAGMA user_version;. Record the value.PRAGMA quick_check; and PRAGMA integrity_check; on the copy as a consistency check, not a compatibility guarantee.user_version is higher than the target build expects, do not force it lower. Export bookmarks from the current Firefox or remain on a compatible version.Provide the exact target Firefox build/version and the current PRAGMA user_version from the copied database. That detail changes the recommendation because compatibility is version-specific.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 05 May 2023, 04:37 UTC
Firefox treats the Places user_version as forward-only and exposes no downgrade-compatibility flag or pre-migration integrity API. Manually lowering the pragma does not undo newer tables, indexes, or row formats, so an older build can still detect an incompatible schema and reset Places.
Before testing a downgrade, copy the entire profile including places.sqlite, its WAL and SHM files, then inspect PRAGMA user_version; on the copy. Launch the older Firefox from that copy and check about:support and the browser console for Places initialization errors before risking the production profile.