Thanks for the tip - how would I do that exactly? I'm negligibly familiar 
with DBs and not hugely interested in figuring out something so trivial on 
my own. Thanks!


On Tuesday, September 3, 2024 at 3:57:49 PM UTC-6 vince wrote:

> Gary you can do a sqlite3 backup of one db, and restore that into the 
> other db (always working off copies of course).  Sqlite3 is smart enough to 
> ignore any duplicate records.  Then do the rebuild-daily to rebuild the 
> summary tables.
>
> On Tuesday, September 3, 2024 at 2:26:04 PM UTC-7 Gary S wrote:
>
>> On Sunday, September 1, 2024 at 5:51:40 PM UTC-6 matthew wall wrote:
>>
>> [...]
>>
>>
>> do something like this (NOT TESTED!!!):
>>
>> # stop weewx
>> sudo launchctl unload /Library/LaunchDaemons/com.weewx.plist
>>
>> # make a copy of the old database and the active database
>> cp /Users/shared/weewx/archive/weewx.sdb weewx1.sdb
>> cp ~/weewx-data/archive/weewx.sdb weewx2.sdb
>>
>> # move aside the active database
>> mv ~/weewx-data/archive/weewx.sdb ~/weewx-data/archive/weewx.sdb-YYmmdd
>>
>> # copy new data into the copy of the old database
>> sqlite3 weewx1.sdb
>> sqlite> attach database 'weewx2.sdb' as 'weewx2';
>> sqlite> insert into weewx1.archive select * from weewx2.archive;
>>
>> # rebuild the daily summaries
>> weectl database rebuild-daily
>>
>> # move the newly modified database into place
>> cp weewx1.sdb ~/weewx-data/archive/weewx.sdb
>>
>> # start weewx
>> sudo launchctl load /Library/LaunchDaemons/com.weewx.plist
>>
>> # clean up
>> rm weewx1.sdb weewx2.sdb
>>
>>
>> Thanks! You've put me on the right path.
>> My remaining issue is that my old weewx.sdb and current weewx.sdb overlap 
>> in time, as expected, so insertion fails. Once I figure out the appropriate 
>> syntax for SQL I'll strip one or the other of the appropriate piece and 
>> reassemble.
>> If only these were netCDF files I'd be done in about two seconds...
>>  
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/24627775-ed3d-4163-b520-64b6f8aa8b5an%40googlegroups.com.

Reply via email to