*Do this at your own risk. I'm not responsible for lost data* 

1) Stop weewx

2) Make a backup of the database. Adjust your path as necessary

*cp /home/weewx/archive/weewx.sdb **/home/weewx/archive/weewx-backup.sdb*

2.1) Make sure you have a backup of your database. Verify with 

*ls -al /home/weewx/archive/ *

2.2) If you feel comfortable that you have a backup of your database move 
to step 3.

3) Run this command. It will delete all rows where the timestamp's year is 
2017. Change 2017 if you want to focus on another year. 

*sqlite3 /home/weewx/archive/weewx.sdb*

*DELETE FROM archive WHERE strftime("%Y", datetime(dateTime, "unixepoch", 
"localtime")) = "2017"*

4) Rebuild your daily values with the below. You can skip the drop-daily, 
but you may want to run it so it will drop all your daily records which 
should purge anything from 2017 that's lingering. 

*sudo wee_database --drop-daily*
*sudo wee_database --rebuild-daily*

5) Start weewx

If for some reason something get's messed up, you can stop weewx. Rename 
your backup database back to the primary (with *cp 
/home/weewx/archive/weewx-backup.sdb /home/weewx/archive/weewx.sdb*), start 
weewx. Walk away for a bit to clear your head, come back and try again from 
step 1. 




On Tuesday, August 21, 2018 at 12:51:01 PM UTC-4, Cycle London wrote:
>
> How do I remove that/those date(s)? 
>
> I did google, but the wiki isn't very good and none of the rest seem to be 
> any good, either. Ah, not to worry.  
>
> On Tue, 21 Aug 2018 at 17:42, vince <[email protected] <javascript:>> 
> wrote:
>
>> On Tuesday, August 21, 2018 at 8:57:51 AM UTC-7, The VPN Man wrote:
>>>
>>> [root@weather ~]# sqlite3 /home/weewx/archive/weewx.sdb
>>> SQLite version 3.7.17 2013-05-20 00:56:22
>>> Enter ".help" for instructions
>>> Enter SQL statements terminated with a ";"
>>> sqlite> select dateTime, datetime(dateTime,'unixepoch','localtime') from 
>>> archive order by dateTime limit 1;
>>> 1494356520|2017-05-09 20:02:00
>>> sqlite> 
>>>
>>> No idea how to hose that, though. 
>>>
>>>
>> 'hose' that ?
>>  
>>
>>> Is there a good, comprehensive guide to switching to MySQL?
>>>
>>>
>> I'd probably google for "weewx mysql 
>> <https://www.google.com/search?client=safari&rls=en&q=weewx+mysql&ie=UTF-8&oe=UTF-8>"
>>  
>> and look at the first 4 links that it returns....
>>
>>  
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "weewx-user" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/weewx-user/5kgytbXX5pY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to