mysql data import from weewx 3.9. in 4.0

81 views
Skip to first unread message

Joachim Puttkammer

unread,
May 11, 2020, 6:53:13 AM5/11/20
to weewx-user
Hi all,
I have reinstalled weewx 4.0 and now I want to import the old mysql DB (weewx 3.9). Unfortunately there is a problem with the import, because the old archive table has 52 columns and the new one has 114 columns.

Graham Eddy

unread,
May 11, 2020, 7:06:09 AM5/11/20
to weewx...@googlegroups.com
unless you are using features of the new database, you can simply continue using the old database (no unload/reload - keeping a copy of old database before using it with updated weewx, of course).
g-eddy

On 11 May 2020, at 8:53 pm, Joachim Puttkammer <jputt...@gmail.com> wrote:

Hi all,
I have reinstalled weewx 4.0 and now I want to import the old mysql DB (weewx 3.9). Unfortunately there is a problem with the import, because the old archive table has 52 columns and the new one has 114 columns.


--
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/c272a9ba-2c83-416d-b351-64834bcfad63%40googlegroups.com.

Joachim Puttkammer

unread,
May 13, 2020, 1:05:05 PM5/13/20
to weewx-user
I will briefly describe what I have done.
1. weewx database saved (mysqldump)
2. update from 3.9 to 4.0
3. Installed Belchertown skin and found that there are problems with the NOAA reports
4. 4.0 completely uninstalled (all weewx files, folders and database) and reinstalled, and transferred the all backed up settings.
5. Did not remember that the weewx.conf 3.9 has the entry 'target_unit = METRICWX'. With the 4.0 it says 'US'.  After days database saved and weewx database deleted. 'target_unit' changed back to METRICWX.

Conclusion:
1 Database A with METRICWX and old structure 3.9
1 Database B with METRICWX and new structure 4.0
1 Database C with US and new structure 4.0
I imported the METRICWX Database A with a php script into Database B. Now I want to import Database C as well, but how?

I want to keep the structure of the 4.0 Database.

greetings
Joachim

Tom Keffer

unread,
May 13, 2020, 3:39:46 PM5/13/20
to weewx-user
Heavens. You are making this way more complicated than necessary. There is no "V4.0 database" --- the database has not changed. The only new thing is the opportunity to use an extended schema. But, if the original "wview" schema is working fine for you, don't do anything.

1. Go back to your original "Database A". Get rid of the rest.

2. Go back to your original V3.9 setup. Get rid of the rest.

3. Do a simple upgrade as you always have:

sudo apt-get update
sudo apt-get install weewx

4. Then install the Belchertown skin.

Now you're running on WeeWX V4 with Python 2. 

5. If you do want to use the extended schema, perhaps because you have some new sensors that can take advantage of the extended schema, follow the directions I gave in this post. Otherwise, don't do it.

6. If you want to change to Python 3, then you'll have to switch repositories. Assuming a Debian 10 system, follow the directions here. If you have a Debian 9 system, it's more complicated, and we recommend staying with Python 2.


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

Joachim Puttkammer

unread,
May 13, 2020, 3:59:12 PM5/13/20
to weewx-user
When I go back to V3.9 and "Database A", then I will lost datas for two weeks.
So now I leave everything and live with a much smaller data gap.

I expressed myself unhappily regarding the new database.
I meant the new database now has over 100 tables and an alphabetical order compared to the previous.

Joachim
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages