Latest LQ Deal: Latest LQ Deals
Go Back > Blogs > linux-related notes
User Name


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Rate this Entry

Exporting / importing Chrome/Chromium's search engines through command line + sqlite3

Posted 04-08-2017 at 03:01 PM by the dsc
Updated 04-08-2017 at 03:05 PM by the dsc

I don't know anything about it, except that it seems to have worked without problem:

OK . . . you can do this on a Mac (or a Linux box, I presume) by manipulating a SQLite database. Presumably you could do the same thing on a PC with a command line tool euqivalent to sqlite3 that's available in a *nix environment.

Here's the steps (with Chrome quit in each case):

(1) Open a terminal; get to the Chrome application data "Default" directory. (On a Mac: ~/Library/Application Support/Google/Chrome/Default ; on a PC <User>\Local Settings\Application Data\Google\CHrome\User Data\Default)
(2) Execute the command: sqlite3 "Web Data" .dump keywords > keywords.sql
This will dump the SQL commands necessary to recreate the search settings into the "keywords.sql" file.
(3) Grab the keywords.sql file and take it with you.

On the import machine:
(1) Open a terminal; get to the Chrome application data "Default" directory.
(2) Copy the keywords.sql file into that directory.
(3) Execute the command: sqlite3 "Web Data"
This will give you the sqlite interactive shell
(4): Execute the following commands in that shell
DROP TABLE keywords;
.read ./keywords.sql

In order, that wipes out the existing search settings entirely, reads in the new ones you're importing, and then closes the sqlite environment.
From user sjsawyer's answer on google groups:

I guess theoretically you could just copy the database file if you have just a fresh install of one of them, but perhaps if you already used it for a while and then thought "gosh, I can't believe I haven't set up search engines like I had on the other browser/install", it could be useful, as it theoretically copies only more or less what's actually needed. I'm not sure but I guess it may be copying also log-ins and passwords, though, I just browsed it a little bit in a SQL GUI thing, but I can't really tell. The whole file also contains stuff related with extensions and more stuff in general, so it could corrupt other stuff, if you copy the entire database into a non-fresh install. But one could always copy the entire "default"/other profile sub-folder, anyway. I guess.

Obviously also works for the same machine, if you have different-but-similar browsers installed for some reason, or dual boots with another distro, or perhaps even windows, but I'm not sure on the latter. I guess the SQL thing is probably the same still.
Posted in Uncategorized
Views 568 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 10:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration