2022 Year data not calculated in SQLite database weewx.sdb

118 views
Skip to first unread message

lloyd...@gmail.com

unread,
Sep 15, 2022, 7:04:52 PM9/15/22
to weewx-user
I stopped weewx, copied the data base weewx.sdb to a backup location and then restarted weewx. When I look at Yearly reports for 2022 I only have data from the month I restarted it (August). But if I look at monthly reports for January through July I have data there. Also when I look at the current data page and select year data there is nothing from 9/1/21 to 8/1/22. 
Anyway to rebuild that yearly data for 2022?

gjr80

unread,
Sep 15, 2022, 8:37:46 PM9/15/22
to weewx-user
First thing to do if you are viewing the file(s) via a web browser is to clear the browser cache. You can try viewing the files directly via an editor or cat'ing them to a console. Second thing to try is forcing WeeWX to regenerate all of your NOAA format month and year files. Delete all of the month and year files on your WeeWX machine, wait for the next report cycle to complete during which WeeWX will regenerate them all. Be patient, depending on how much data you have in your database it could take a while. Once they have be regenerated have look and see what's there. Again be careful of browser caches if viewing via a browser.

If you still have issues post back here.

Gary

lloyd...@gmail.com

unread,
Sep 19, 2022, 12:33:16 PM9/19/22
to weewx-user
According to what I am seeing in sqlitebrowser, I have managed to mess up the database and its backup. It goes from August 4, 2021 to August 2, 2022 with nothing in between. Of course I was not smart enough to save any of the *.txt files in  the NOAA directory. And my other database backup is from August 4, 2021 which was in /home/weewx/Documents. Seems strange that is the date. Oh well. I do have another machine that was reading the exact same data for that period using a SDR so now all I have to do is somehow piecemeal the 2 databases to get the data for Aug 4,2021 through Aug 2, 2022 into the database that has data from 2016. 

Any suggestions as how to pick data from one database and put it in the other database? I assume I will have to use sqlite3.

vince

unread,
Sep 19, 2022, 2:44:15 PM9/19/22
to weewx-user
Dump and restore the archive table and ignore any 'duplicate entry' warnings you might see....

As always work off 'copies' of your databases...

lloyd...@gmail.com

unread,
Sep 19, 2022, 8:47:32 PM9/19/22
to weewx-user
Thanks for the reply. I tried what I think you said and can't restore.
I have 2 databases call them w177.sdb and w166.sdb .
w177 has 6 years of data from 2016 to Aug 4, 2021, w166.sdb has 1 year of data from Sept 2021.
I want to combine them.
I  did a sqlite3 w166.sdp . dump archive > dum166.sql.
Tried a sqlite3 w177.sdb < dum166.sql
         and it sure didn't like that, complained  table archive has 52 columns but 114 values were supplied & UNIQUE constraint failed: archive_day_***** for all of them.
Tried a sqlite3 .restore w177.sdb dum166.sql
       and that did not work

Any suggestions on what I am doing wrong?

vince

unread,
Sep 20, 2022, 12:23:58 AM9/20/22
to weewx-user
yes, you need to have the same number of columns in both to do the save+restore.   You can convert (update) your smaller file to the newer (bigger) extended schema that is the current default.

lloyd...@gmail.com

unread,
Sep 20, 2022, 5:54:27 PM9/20/22
to weewx-user
Thank you, thank you, thank you.  Had my search ability been better and had I noticed one database schema was not like the other I might have not had to bother you, so thanks for putting up with my questions. I think I finally have something that is working that has the combined databases running on the SDR machine.
Reply all
Reply to author
Forward
0 new messages