Move WeeWx database to external drive

95 views
Skip to first unread message

Ben W.

unread,
Apr 1, 2024, 8:54:43 AMApr 1
to weewx-user
Hello!

My setup is slowly coming together. Currently, I am able to see the data on my local network via browser at 192.168.7.201/weewx. I feel pretty accomplished so far, but I know I have a long ways to go. Before I get too far, my intent is to use my attached external hard drive to store the data for WeeWx. I'm pretty sure the data is being saved to the microSD card right now.

Would someone be able to direct me on how to move the database to my external drive and instruct WeeWx to use that location going forward?

I installed WeeWX V5 using 'apt' and the instructions here: https://weewx.com/docs/5.0/quickstarts/debian/

What I'm using:
Ambient Weather WS-5000 weather station
Ecowitt GW1100 hub
RPi 5 8GB "headless"
2TB HDD drive


Thanks!

Jon Fear

unread,
Apr 1, 2024, 9:11:18 AMApr 1
to weewx-user
I am doing something similar using my NAS.

I have mounted the NAS and then created symbolic links to the appropriately named folders or directories on the NAS. When mounting the NAS, I needed to make sure that the permissions were correct for weewx which was eventually quite simple to achieve. If you are mounting the complete drive via say USB then it should be simple, just remember to create the appropriate directories and make sure the permissions are set correctly.

Best of luck..

Jon

Ben W.

unread,
Apr 2, 2024, 7:13:13 AMApr 2
to weewx-user
Hi, John! 
Yes that is exactly what I'm trying to do as with your NAS, but with an external drive USB-connected to the RPi. It's mounted and I can write to it. I just haven't quite figured out (or found the resource yet) to update the appropriate weewx conf file to tell weewx to use the directory on the drive rather than the current (default ?) directory that is used.

Thanks!

Jon Fear

unread,
Apr 2, 2024, 7:23:01 AMApr 2
to weewx-user
Hi Ben

I was sneaky, I moved the weewx directories to the NAS and then created the symbolic link in the place of it. I am lucky in that I have a production system on 4.10.0 whilst I build my 5.0.2 system. It is really important to get the permissions right otherwise it will be a disaster...!

I also insert snapshots and video from my weather camera's at that stage. The VM that creates the snapshots and timelapse also has shared directories on the NAS...

This is where stuff "should" be located... 


Good luck

Jon

Tom Keffer

unread,
Apr 2, 2024, 7:29:15 AMApr 2
to weewx...@googlegroups.com
It's really very simple. Just set SQLITE_ROOT to the directory where you want the database to be saved. You'll find it under [[SQLite]]

[DatabaseTypes]
  ...
  [[SQLite]]
    ...
    SQLITE_ROOT = /path/to/your/sqlite/dir



--
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/1c310abb-7b22-45ef-8ad1-39a6d45aa01en%40googlegroups.com.

Ben W.

unread,
Apr 2, 2024, 7:31:37 AMApr 2
to weewx-user
Thanks, Jon! I changed the directory in the weewx.conf file to point to the external drive's symbolic link rather than /var/lib/weewx. The result was a critical error:

CRITICAL __main__: Database OperationalError exception: unable to open database file

So it seems it is a permissions issue as you suggest. I will focus on that next - much appreciated!

Ben W.

unread,
Apr 2, 2024, 7:55:10 AMApr 2
to weewx-user
I did see that, but I have a permission issue that I need to solve for now.

I really appreciate all your comments/posts over the past years. I've been able to find a lot of answers from your posts. You are very patient and helpful!

Thank you!
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages