merge two data base

345 views
Skip to first unread message

sali...@gmail.com

unread,
Oct 23, 2023, 5:07:14 PM10/23/23
to weewx-user
hello,
I put my station into service on a new weewx installation, operation OK. How can I recover the old database to add it to the new one? am I clear enough?

thanks

Patrick

salinois

unread,
Oct 23, 2023, 5:33:35 PM10/23/23
to weewx...@googlegroups.com

I found this in the mails from Vince;

is it the good methode ?

[I do it manually via dump and restore using sqlite3...

  • Stop weewx
  • Make a copy of your old and new db and work off those copies
    • cp weewx.sdb          /var/tmp/weewx.new.sdb
    • cp your_old_weewx.sdb /var/tmp/weewx.old.sdb
    • cd /var/tmp
  • Dump your old database's archive table to a file
    • echo ".dump archive" | sqlite3 weewx.old.sdb > old.dump.txt
  • Restore that into your new database
    • "cat old.dump.txt | sqlite3 weewx.new.sdb"
    • (and ignore the 'table already exists' warning)
  • Rebuild your daily summaries
    • rename your production weewx.sdb file to something else
    • copy the weewx.new.sdb built above into place as weewx.sdb in the directory weewx expects it in
    • sudo wee_database --rebuild-daily
  • Start weewx]

thanks


Patrick

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/d15daeff-4d57-4bdb-a38f-6f9ef5499e3bn%40googlegroups.com.

vince

unread,
Oct 23, 2023, 7:08:39 PM10/23/23
to weewx-user
Try it please.

salinois

unread,
Oct 24, 2023, 11:29:30 AM10/24/23
to weewx...@googlegroups.com

hello Vince,

this command doesn't work !!

"cat old.dump.txt | sqlite3 weewx.new.sdb"

I try to find the good command

thanks

patrick

Le 24/10/2023 à 01:08, vince a écrit :
"cat old.dump.txt | sqlite3 weewx.new.sdb"

salinois

unread,
Oct 24, 2023, 2:27:53 PM10/24/23
to weewx...@googlegroups.com

hello,

I successfully completed this order cat old.dump.txt | sqlite3 weewx.new.sdb without the double quotes 

but after changing the rights on the file "sudo chmod 777 weewx.new.sdb ";

I restarted weewx, and the old years appear in report but no data in it!!!

did I do something wrong?

Patrick

salinois

unread,
Oct 27, 2023, 3:54:05 PM10/27/23
to weewx...@googlegroups.com

hello Vince,

dis you see this message ?

thank

Patrick

Reply all
Reply to author
Forward
0 new messages