I needed to upgrade Raspbian from Stretch to Buster, Python from 2 to 3, 
and weewx from 3 to 4.  So it seemed to make more sense to install 
everything fresh rather than upgrade anything in place. That all worked 
great.

But then I got distracted and let the new system run for several weeks 
before discovering that I hadn't copied my old weewx.sdb over.  So now I 
have several weeks' of data in a database with the new expanded structure, 
and 7 years' worth in another sdb with the old structure.  And some of the 
new data have aged off of my TE923, so I can't just re-download them.

So I'm trying to get everything into one database with the expanded 
structure.

I used sqlite3 to dump the new records into recent.sql.  Then I backed up 
weewx.sdb and replaced it with my old one.  
Following 
https://github.com/weewx/weewx/wiki/Switching-to-the-new-wview_extended-schema, 
I ran wee_database weewx.conf --reconfigure and renamed weewx.sdb_new to 
weewx.sdb.  Then I ran wee_database weewx.conf --rebuild-daily and renamed 
weewx.sdb_new to weewx.sdb.  

And now I'm trying to import the new records from recent.sql.

When I just did sqlite3 weewx.sdb < recent.sql, I got errors because it 
tried to create tables that already existed.  So I edited recent.sql to 
just include the INSERT statements.  And now sqlite3 weewx.sdb < recent.sql 
gives errors about tables that don't exist.  

I can put the CREATE TABLE statements back in for the missing tables, but 
they have names like archive_day_appTemp, archive_day_appTemp1, and 
archive_day_barometer, so they look like things the --rebuild-daily should 
have created.  So now I'm afraid I missed something.

What am I doing wrong?

If it'd be better to try to import the new data into the old-format 
database, I can go back and do that.  I just figured since I needed to do 
something I might as well get the new format and be ready for any future 
changes.

Or is it possible to use two databases at once?  7 years of data in one sdb 
makes for long backups and big dump files -- I've been caught by 
cross-architecture problems with sqlite files in the past, so I prefer to 
save my data in text files for preservation.  If I could use the old sdb 
for historical reports and save new data to a new file, my active file 
would be a whole lot smaller.  Is that possible, and can they use different 
schemas?

Thanks!

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/103f48a8-9847-4754-ba29-fed81ec5eebco%40googlegroups.com.

Reply via email to