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