Losing Weewx DB data

83 views
Skip to first unread message

Kruse Ludington

unread,
Aug 22, 2022, 2:05:13 PM8/22/22
to weewx...@googlegroups.com
From time to time when I back up my weewx setup I then have to later restore it when things go south. (This has happened from time to time as all this is running on a Raspberry pi which also has a lot of other things running in containers such as home assistant etc.)

When this happens of course I lose the weewx data between the date of the backup and the date of the restore.

Therefore I'd like to backup the data on a daily basis such that when I restore the entire system from an old backup, I can as a last step, then overlay that with the database backup made within the last 24 hours, to minimize the data lost.

So my question comes down to how do I backup and restore just the data? Are there specific files or if there are a huge number of foreign keys is it much more complicated...? Is it just the date pure database or is it also related configuration or log files? I am currently using the default database with no changes that comes with weewx... 

Thank you for your help!

Best Regards,

-R. Kruse Ludington

Rainer Lang

unread,
Aug 22, 2022, 3:24:43 PM8/22/22
to weewx...@googlegroups.com

Many ways lead to Rome ...

I'm running two weewx installations on two separate RPi4Bs in parallel. They are mirrors.
If one has to go down or just goes down, I can later on copy the database over from the still running installation.
Each installation is backed up to an external HDD every five minutes after the archiving interval. Thi minimizes the potential data loss.
Every two days a housekeeping script will only keep the midnight backups and delete the others to free space on the disk.
This setup/strategy has kept me safe through all incidents so far.
My weather consoles, the WiFi router and the RPis are protected by a UPS (uninterrupted power supply).
Like this Blackouts less than one hour do not impact my weather hardware.

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/182c6babc98.29af.c5c13ad976ec84a62e2892bf98a0657b%40gmail.com.

vince

unread,
Aug 22, 2022, 5:22:27 PM8/22/22
to weewx-user
On Monday, August 22, 2022 at 11:05:13 AM UTC-7 rklud...@gmail.com wrote:
So my question comes down to how do I backup and restore just the data? Are there specific files or if there are a huge number of foreign keys is it much more complicated...? Is it just the date pure database or is it also related configuration or log files? I am currently using the default database with no changes that comes with weewx... 


There are 'many' threads here about how to do this, along with pointers to scripts and best practices folks have used on their setups.  Do a little google searching of the group archives....

Short answer:
  • you need your db
  • you need your weewx.conf
  • ideally you keep a record of which extensions/skins you installed (run 'wee_extension --list')
  • you can restore everything given the above

What I do here:
  • back up my databases (plural) nightly via cron
  • weekly copy the latest to Dropbox to have a copy offsite
  • I also have a full copy of /home/weewx in Dropbox for safekeeping
  • I rsync my public_html to my AWS Lightsail VM so that has my latest public_html tree offsite there
Reply all
Reply to author
Forward
0 new messages