As discussed here: brave/brave-browser#695
Thanks to the excellent answer by @Redsandro I was able to do this on Windows, which I'll document below because my future self will inevitably find this via Google a few years from now. Since it's using SQLite it should not be too hard to adapt for Macos and Linux.
Edit: this method still worked as of 9/3/2023. :)
Note, this gist shows how to get your search engines to and from Chrome, Edge and Brave, but should apply to most Chromium based browsers (e.g. Chromium, Vivaldi, etc.).
First install Sqlite
. The easiest way is via winget, as it automatically creates aliases:
winget install SQLite.SQLite
Or install it manually by downloading sqlite3.exe
, which you can find under the "Precompiled Binaries for Windows" section at https://www.sqlite.org/download.html. Then extracte it and place it in the root, so the full path is something like C:\sqlite-tools-win32-x86-3390400
.
Then open PowerShell, navigate to the new sqlite-tools-win32-x86-3390400 folder (if you installed it manually), and run the following commands. Make sure you change for your system's username. Also make sure all browsers are fully closed.
Here's how you do it with Chrome on Windows:
.\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\Google\Chrome\User Data\Default\Web Data' ".dump keywords" > search-engines.sql
.\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\Web Data' "DROP TABLE keywords"
cat search-engines.sql | .\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\Web Data'
If Edge is your browser it's pretty much the same thing:
.\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\Microsoft\Edge\User Data\Default\Web Data' ".dump keywords" > search-engines.sql
.\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\Web Data' "DROP TABLE keywords"
cat search-engines.sql | .\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\Web Data'
Of course the reverse is also possible. Here's how you go back from Brave to Edge:
.\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\Web Data' ".dump keywords" > search-engines.sql
.\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\Microsoft\Edge\User Data\Default\Web Data' "DROP TABLE keywords"
cat search-engines.sql | .\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\Microsoft\Edge\User Data\Default\Web Data'
And finally Brave to Chrome:
.\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\Web Data' ".dump keywords" > search-engines.sql
.\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\Google\Chrome\User Data\Default\Web Data' "DROP TABLE keywords"
cat search-engines.sql | .\sqlite3.exe 'C:\Users\<USERNAME>\AppData\Local\Google\Chrome\User Data\Default\Web Data'
Hope this helps someone else (or future me).
Firefox does not currently sync your search engines. There's a 15 (!) year old bug report for this issue which you can find at https://bugzilla.mozilla.org/show_bug.cgi?id=444284. In the comments I found a link to a Mozilla Connect "idea" that you should upvote if you're interested in having this be a feature (link: https://connect.mozilla.org/t5/ideas/sync-search-engine-settings/idi-p/366). In the comments there I found instructions posted by IndefiniteBen (https://connect.mozilla.org/t5/ideas/sync-search-engine-settings/idc-p/31872/highlight/true#M18239) on how to copy your search engines over to a new install, which I am quoting verbatim below for ease of access.
IndefiniteBen
05-16-2023 03:28 AM
Assuming copying from one PC to another
Close FF on both PCs
Navigate to your profile folder on the old PC: %APPDATA%\Mozilla\Firefox\Profiles\
Find file search.json.mozlz4
Copy file to USB/Cloud Service
Download to new PC and copy to your profile folder (replace the existing file)
Open FF on your new PC and enjoy your search engines and keywords
Note: when I reopened FF after doing this my default search engine had been changed, so you may need to manually reset the default.