Skip to content

Instantly share code, notes, and snippets.

@nico-abram
Created September 15, 2022 02:44
Show Gist options
  • Save nico-abram/d972c881e72a00833a8993ae9a88fa1a to your computer and use it in GitHub Desktop.
Save nico-abram/d972c881e72a00833a8993ae9a88fa1a to your computer and use it in GitHub Desktop.
sqlite3 commands to migrate old firefox places.sqlite history
-- sqlite3 commands to migrate old firefox places.sqlite history
-- Run the sqlite command line (https://www.sqlite.org/cli.html)
-- on a copy of your backed up places.sqlite (sqlite3.exe places.sqlite), and run these commands:
DROP INDEX moz_places_faviconindex;
ALTER TABLE moz_places DROP COLUMN favicon_id;
ALTER TABLE moz_places ADD COLUMN origin_id INTEGER;
UPDATE moz_places SET origin_id=NULL;
ALTER TABLE moz_places ADD COLUMN site_name INTEGER;
UPDATE moz_places SET site_name=NULL;
ALTER TABLE moz_historyvisits ADD COLUMN source INTEGER;
ALTER TABLE moz_historyvisits ADD COLUMN triggeringPlaceId INTEGER;
UPDATE moz_historyvisits SET triggeringPlaceId=0;
UPDATE moz_historyvisits SET source=0;
.output ./dump.txt
.dump moz_places
.dump moz_historyvisits
.quit
-- Move dump.txt from the places.sqlite folder to the folder for
-- a new blank profile (about:profiles)
-- Comment the 2 CREATE TABLE lines in dump.txt, then import with
-- .read ./dump.txt
-- an empty places.sqlite generated for the blank profile (Run sqlite3.exe places.sqlite on the new one)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment