How to use old (v4.x.x) weewx.sdb in v5.1

113 views
Skip to first unread message

choc...@gmail.com

unread,
Aug 17, 2025, 8:22:10 PMAug 17
to weewx-user
I tried just replacing the weewx.sdb in a fresh install of v5.1 with my old one.

Problem is the records being written to the sdb are indicating dates in the future.
"Added record 2025-08-26 05:00:00 PDT"

The date/time on the pi and Vantage Pro are accurate to within a few seconds.

What is happening and how do I correct it.

Tom Keffer

unread,
Aug 17, 2025, 9:19:21 PMAug 17
to weewx...@googlegroups.com
See your other post. In particular, post a full log from startup through the first reporting cycle. 

--
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 visit https://groups.google.com/d/msgid/weewx-user/3afcf02b-cd6c-4fad-87a7-3997239a2778n%40googlegroups.com.

Tom Keffer

unread,
Aug 17, 2025, 9:21:22 PMAug 17
to weewx-user
Did you delete your other post? My response bounced. Here is my response:

Man, you're not giving us a lot of information.

This error occurs when weewx attempts to write a record that is already in the database. This can happen if the clock is not synchronized --- the computer thinks time is farther in the past than it actually is.

What kind of computer? Does it have a real-time clock?

What kind of weather station?

If you can't figure it out, post a full log, not just single lines from a status command.  See the wiki article, "Help! Posting to weewx-user".


choc...@gmail.com

unread,
Aug 18, 2025, 12:57:01 AMAug 18
to weewx-user
First of all, I apologize profusely for deleting my first post before refreshing the page to see if there were any responses.
At the risk of asking two questions in the same post, what is the correct procedure for using an archival .sdb in a fresh install of weewx?

Second issue: Dates mismatch.
Attached is a debug=3 log.  The, 'dates in the future' issue is not indicated but, errors still exist.

Thanks.
mylog.txt

Graham Eddy

unread,
Aug 18, 2025, 1:09:16 AMAug 18
to WeeWX User
if all you wish to do is move forward from whatever is in the ‘old’ weewx.sdb, just copy it into the archive/ directory and start weewx (making sure permissions are correct). there will be a gap between the last timestamp in the old .sdb and the current time.
it does not matter if archive interval is different.
if the last timestamp is newer than current time (e.g. if clock was or is screwed) then this has to be resolved as a semantics problem - it must be monotonic

also, since you mention ’fresh’ install, make sure you are using the same/consistent schema and database manager
⊣GE⊢

choc...@gmail.com

unread,
Aug 18, 2025, 2:27:41 AMAug 18
to weewx-user
"make sure you are using the same/consistent schema and database manager"

Please expand on this.

Graham Eddy

unread,
Aug 18, 2025, 2:39:42 AMAug 18
to WeeWX User
you should see something like this in weewx.conf:

[DataBindings]                                                                      

    [[wx_binding]]                        

        # The database must match one of the sections in [Databases].

        # This is likely to be the only option you would want to change.

        database = archive_sqlite         

        # The name of the table within the database

        table_name = archive              

        # The manager handles aggregation of data for historical summaries

        manager = weewx.manager.DaySummaryManager

        # The schema defines the structure of the database.

        # It is *only* used when the database is created.

        schema = schemas.wview_extended.schema

⊣GE⊢

--
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.

Tom Keffer

unread,
Aug 18, 2025, 6:36:37 PMAug 18
to weewx...@googlegroups.com
At some point, your database got contaminated with timestamps from the future. This could be because you have the simulator set up wrong. Normally, it emits archive records in real-time. That is, at 08:05, it emits an archive record for 08:05. However, it can be set in "generator" mode, where it emits records as fast as it can. This is useful for testing periods. I suspect that it got put in this mode, causing it to emit lots of records in the future. Check the [Simulator] section of your configuration file.

In any case, if your database has data that you wish to keep, you will need to repair it. See the wiki article Deleting unwanted data. The example it gives is about bad data at the beginning of a database --- yours will be at the end. You will need to adjust accordingly.

For obvious reasons, do not restart weewxd until you either fix the [Simulator] section, or switch to the actual weather station you plan on using.

-tk

--
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.
Message has been deleted

choc...@gmail.com

unread,
Aug 19, 2025, 11:24:09 AMAug 19
to weewx-user
Tom,  
Fortunately, I was using a copy of my historical weewx.sdb so trying to edit the database was not necessary.  I just deleted the "future day" one, replacing it with the known good version.
When I first started the RPi, I took your suggestion and immediately stopped the weewx service, physically attached the Vantage Pro to the pi, edited weewx.conf to replace Simulator with Vantage and restarted weewx.
Watching the syslog activity, the data from the last several days was being written to the database.  Wahoo!
Now I have all my data from 2017 to today with nothing missing.

Gerry,
I was UTL an archive folder.  As I described above, I just replaced the weewx.sdb created by the fresh install with my historical version. I did have to tweak the file's permissions but, now all is well.

Anyone reading this,
All of this wailing and gnashing of teeth was brought on by a power outage and could have been avoided by simply making a copy of the SD card.
Something I will be doing right after I post this message.
Now to rebuild my skins.

Thank you guys for helping me.  I appreciate it.
Reply all
Reply to author
Forward
0 new messages