Question regarding new 4.x schema

81 views
Skip to first unread message

Manfred Nadymacek

unread,
Jan 22, 2021, 4:33:38 AM1/22/21
to weewx-user
Hi all,
My problem is following:
I run since 4,5 years my weewx station hosted on a raspberry pi.
I start 2016 with a prober version and update it to latest 3.9 version.

Now  I reinstall a new raspberry Pi with lastest raspian version and weewx 4.3 and do also all new configuration and add new skins aso...

BUT: I found out that the old version has following Databinding:
[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.wxmanager.WXDaySummaryManager
        # The schema defines the structure of the database.
        # It is *only* used when the database is created.
        schema = schemas.wview.schema


And in the new config has already the new extrended schema:
[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

My idea would be i will shutdown the old weewx instance and copy the old database to the correct folder in the new installed weewx version.
BUT i guess that will not work and my fear is the old data are lost or not visible.

CAN anybody help me to migrate the old sqlite database to the new 4.x schema standard without lost my history data??

Thx very much!
Manfred



Tom Keffer

unread,
Jan 22, 2021, 8:56:14 AM1/22/21
to weewx-user
The schema is used only when you create a new database. WIth old databases, the schema is read directly from the database. So, you can just copy your old database to the new installation. WeeWX will continue to work.

If you want to change schemas, that's something different, but there is no reason to do so unless you want to take advantage of the new types.

-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.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/8d31bb56-0b2c-4e77-956b-57decefd4cf3n%40googlegroups.com.

Manfred Nadymacek

unread,
Jan 22, 2021, 12:58:12 PM1/22/21
to weewx-user
Thx for answering, I did following after long search....
Copy from old instance to the new installed 4.3.x version.
Then wee_database weewx.conf --reconfigure
replace _new db to orig name....
Restart and rebuilt daily summary take ~1 houre for 500000 records
now it's migrated to new schema so for future features releases.

br

Tom Keffer

unread,
Jan 22, 2021, 1:06:28 PM1/22/21
to weewx-user
Well done, but, as I said, there is no reason to migrate to the new schema unless you intend to take advantage of the new database types.

Manfred Nadymacek

unread,
Jan 22, 2021, 1:23:02 PM1/22/21
to weewx...@googlegroups.com
i was confused because this !
Default in 4.3 :
[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

and on my old instance 3.9.x:
[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.wxmanager.WXDaySummaryManager
        # The schema defines the structure of the database.
        # It is *only* used when the database is created.
        schema = schemas.wview.schema


My fear as i said is that only copy cannot work with it... It't not written in the docs...

br

Tom Keffer

unread,
Jan 22, 2021, 1:28:57 PM1/22/21
to weewx-user
If you leave it alone, either will work just fine. 

Manfred Nadymacek

unread,
Jan 22, 2021, 1:32:05 PM1/22/21
to weewx...@googlegroups.com
thx good to know for next time migration.


Reply all
Reply to author
Forward
0 new messages