Weectl import

121 views
Skip to first unread message

J O

unread,
Mar 8, 2024, 4:09:23 PM3/8/24
to weewx-user
Dear community,
I try to import the database of my old weewx installation to the new system (newly installed + new hardware) by exporting CSV file from the old weewx.sdb and import with weectl import onto the new.
The process interrupts and I receive error messages as long as I have NULL values in the CSV (NULL represented by comma separators without any value ",,"). When I remove the NULLs e.g. by "0" the process completes successfully.
Does anybody have an idea, because I do not want to fill up the NULLs with "0" because this is not accurate.
Thank you for support
JO
Here ist the errorlog from weectl import:

Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
Destination table 'archive' unit system is '0x01' (US).
Missing derived observations will be calculated.
All WeeWX UV fields will be set to None.
All WeeWX radiation fields will be set to None.
This is a dry run, imported data will not be saved to archive.
Starting dry run import ...
Traceback (most recent call last):
  File "/usr/share/weewx/weeimport/weeimport.py", line 849, in map_raw_data
    _value = float(_row[self.map[_field]['source_field']].strip())
ValueError: could not convert string to float: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/weewx/weectl.py", line 74, in <module>
    main()
  File "/usr/share/weewx/weectl.py", line 66, in main
    namespace.func(namespace)
  File "/usr/share/weewx/weectllib/__init__.py", line 121, in dispatch
    namespace.action_func(config_dict, namespace)
  File "/usr/share/weewx/weectllib/import_cmd.py", line 82, in import_func
    weectllib.import_actions.obs_import(config_dict,
  File "/usr/share/weewx/weectllib/import_actions.py", line 58, in obs_import
    source_obj.run()
  File "/usr/share/weewx/weeimport/weeimport.py", line 405, in run
    _mapped_data = self.map_raw_data(_raw_data, self.archive_unit_sys)
  File "/usr/share/weewx/weeimport/weeimport.py", line 897, in map_raw_data
    self.map[_field]['unit'] == 'degree_compass':
  File "/usr/lib/python3/dist-packages/configobj.py", line 554, in __getitem__
    val = dict.__getitem__(self, key)
KeyError: 'unit'

gjr80

unread,
Mar 8, 2024, 4:48:16 PM3/8/24
to weewx-user
I am not sure why you are exporting data from your old WeeWX database and then importing the data into a new installation. The WeeWX database is compatible across all WeeWX versions so you can just use it without change in your new WeeWX installation. Your existing WeeWX database may use the old 'wview' database schema rather than the new 'view_extended' database schema, but there is no particular need to upgrade to the 'view_extended' database schema unless you need the additional fields. In any case, you can upgrade an existing WeeWX installation that uses the old 'wview' database schema to the new 'view_extended' database schema by following the instructions at the Switching to the new wview_extended schema wiki page.

I would suggest you just copy your old WeeWX database to your new install and if required later update to the 'wview_extended' database schema.

Gary

J O

unread,
Mar 9, 2024, 4:59:54 AM3/9/24
to weewx-user
Hi Gary,
thanks for your quick response. I'm afraid that I should have done that, but now I already have two databases because the new installation started and the old has been stopped. So I will need to import in the one or the other direction anyway. Or, alternatively, I will loose the data during the overlap time (1+ week).
Jens

Reply all
Reply to author
Forward
0 new messages