Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there a way to merge two different two local places.sqlite file copies together?

1,140 views
Skip to first unread message

Ant

unread,
Nov 9, 2012, 9:38:03 AM11/9/12
to
Hello.

I have two different local copies and would like to merge them together
as one. I do not want to use Mozilla's remote synchronization feature.

Thank you in advance. :)
--
"He who storms in like a whirlwind returns like an ant." --Borneo
/\___/\ Ant(Dude) @ http://antfarm.ma.cx (Personal Web Site)
/ /\ /\ \ Ant's Quality Foraged Links: http://aqfl.net
| |o o| |
\ _ / If crediting, then use Ant nickname and AQFL URL/link.
( ) If e-mailing, then axe ANT from its address if needed.
Ant is currently not listening to any songs on this computer.

Ed Mullen

unread,
Nov 9, 2012, 11:36:38 AM11/9/12
to
Ant wrote:
> Hello.
>
> I have two different local copies and would like to merge them together
> as one. I do not want to use Mozilla's remote synchronization feature.
>
> Thank you in advance. :)

Don't know of any way to import history but you could use Bookmarks
Manager to import from one to the other.

--
Ed Mullen
http://edmullen.net/
Alzheimer's advantage: New friends every day.

David E. Ross

unread,
Nov 9, 2012, 12:13:43 PM11/9/12
to
On 11/9/12 8:36 AM, Ed Mullen wrote:
> Ant wrote:
>> Hello.
>>
>> I have two different local copies and would like to merge them together
>> as one. I do not want to use Mozilla's remote synchronization feature.
>>
>> Thank you in advance. :)
>
> Don't know of any way to import history but you could use Bookmarks
> Manager to import from one to the other.
>

Export the bookmarks from places.sqlite for one instance of the browser.
It will export as an HTML file. Import the HTML file into your
bookmarks -- into places.sqlite -- for the other instance of the browser.

--

David E. Ross
<http://www.rossde.com/>

Anyone who thinks government owns a monopoly on inefficient, obstructive
bureaucracy has obviously never worked for a large corporation.
© 1997 by David E. Ross

Chuck Anderson

unread,
Nov 9, 2012, 10:24:24 PM11/9/12
to
Ant wrote:
> Hello.
>
> I have two different local copies and would like to merge them together
> as one. I do not want to use Mozilla's remote synchronization feature.
>
> Thank you in advance. :)

What about "duplicate" entries; keep or toss? (Duplicate could mean same URL,
or same URL and same title, or ... ?)

If you know how to query databases you could use sqlite3. I would play with
it for a while (SELECT from places.sqlite and INSERT entries into a new
table). http://www.sqlite.org/download.html

--
*****************************
Chuck Anderson • Boulder, CO
http://cycletourist.com
Turn Off, Tune Out, Drop In
*****************************

Ant

unread,
Nov 10, 2012, 12:53:52 AM11/10/12
to
On 11/9/2012 7:24 PM PT, Chuck Anderson typed:

>> I have two different local copies and would like to merge them
>> together as one. I do not want to use Mozilla's remote synchronization
>> feature.
>
> What about "duplicate" entries; keep or toss? (Duplicate could mean
> same URL, or same URL and same title, or ... ?)

Toss if they are exactly the same. I know revisiting the same exact URLs
count has another hit in histories.


> If you know how to query databases you could use sqlite3. I would play
> with it for a while (SELECT from places.sqlite and INSERT entries into a
> new table). http://www.sqlite.org/download.html

Hmm, I don't know SQL unless it is very easy to do. It looks like it is
command line based from that download web page. Maybe there is an easy
how to guide somewhere?
--
"They are like the ant... They start one way and turn around and go the
other way... They look all the time at the ground and never see the
sky." --Davi Kopenawa Yanomami, Amazonian Indian (Newsweek 117(17):5, 1991)

caow...@gmail.com

unread,
May 15, 2015, 10:08:09 AM5/15/15
to mozilla-sup...@lists.mozilla.org
today i wrote this and not work

#!/bin/sh

# usage:
# append-mozilla-history <1> <2>
# both <1> and <2> are sqlite3 databases. <1> is modified.

offset=`sqlite3 $1 "select max(id) from moz_historyvisits;"`

sqlite3 $1 << EOF
attach "$2" as db2;

insert or ignore into moz_places(url,title) select url,title from db2.moz_places;

create view db2.v1 as select db2.moz_places.url, db2.moz_historyvisits.id, db2.moz_historyvisits.from_visit, db2.moz_historyvisits.visit_date
from db2.moz_places inner join db2.moz_historyvisits
where db2.moz_places.id=db2.moz_historyvisits.place_id;

create table t1(id integer, place_id integer, url longvarchar, from_visit integer, visit_date integer);
insert into t1(place_id,id,from_visit,visit_date)
select moz_places.id, db2.v1.id, db2.v1.from_visit, db2.v1.visit_date
from moz_places inner join db2.v1
where moz_places.url=db2.v1.url;
insert into moz_historyvisits(place_id,id,from_visit,visit_date) select place_id, id+"$offset", from_visit+"$offset", visit_date from t1;
EOF

caow...@gmail.com

unread,
May 15, 2015, 7:55:23 PM5/15/15
to mozilla-sup...@lists.mozilla.org
i've largely worked it out. code is published here.
https://github.com/insulsa/merge-firefox-history
please inspect my repo and leave feedbacks.
0 new messages