clear database

74 views
Skip to first unread message

Ian Smith

unread,
Oct 28, 2020, 11:29:28 AM10/28/20
to weewx-user
when moving from initial simulator to actual hardware, what's the best way of clearing out all of the simulated readings from the database?

Thanks

vince

unread,
Oct 28, 2020, 12:03:18 PM10/28/20
to weewx-user
On Wednesday, October 28, 2020 at 8:29:28 AM UTC-7, Ian Smith wrote:
when moving from initial simulator to actual hardware, what's the best way of clearing out all of the simulated readings from the database?


stop weewx, delete the old db, restart weewx and a clean db will be created

Ian Smith

unread,
Oct 29, 2020, 10:34:39 AM10/29/20
to weewx-user
thanks for the reply.  What's the best way to delete the old database?  Scuse my ignorance.

Ian

vince

unread,
Oct 29, 2020, 11:06:11 AM10/29/20
to weewx-user
On Thursday, October 29, 2020 at 7:34:39 AM UTC-7, Ian Smith wrote:
thanks for the reply.  What's the best way to delete the old database?  Scuse my ignorance.



How would you delete a file on a Linux system ?

I'd suggest you get yourself some self-paced Linux training pronto if you're asking such basic questions, before you get stressed navigating Linux.  You 'do' need some minimal expertise for weewx.  There's a good course on edx.org - https://www.edx.org/course/introduction-to-linux

Note the course I mentioned is free.  You don't need to do their for-pay certificate. Just do the class.  Tens of thousands of people have.

Ian Smith

unread,
Oct 29, 2020, 11:17:47 AM10/29/20
to weewx-user
Hi Vince, I've actually spent over 25 years developing real-time embeded software, mainly on linux and solaris based machines.  I don't have much experience with databases, other than postgres but enough to know that you have to be very careful with them to avoid corruption.

When you said that the db should be deleted, I was unsure if I should drop some tables using sql or rm -rf some files.

Any help would be appreciated.

Thanks

Ian

vince

unread,
Oct 29, 2020, 11:25:18 AM10/29/20
to weewx-user
On Thursday, October 29, 2020 at 8:17:47 AM UTC-7, Ian Smith wrote:
Hi Vince, I've actually spent over 25 years developing real-time embeded software, mainly on linux and solaris based machines.  I don't have much experience with databases, other than postgres but enough to know that you have to be very careful with them to avoid corruption.



You're overthinking....I mean simply delete weewx.sdb and it will be recreated from scratch on weewx startup.

You could alternately clean up the records in it, but that's a lot of work.  If you don't have any data you need to save, just start clean the easy way.   Stop weewx, delete one file, start weewx, release the victory beers.

Ian Smith

unread,
Oct 29, 2020, 11:28:35 AM10/29/20
to weewx-user
thanks Vince.  That's great.
Ian
Reply all
Reply to author
Forward
0 new messages