reef pi reset database

waterwombat

New Member
View Badges
Joined
Mar 9, 2023
Messages
2
Reaction score
4
Location
Melbourne
Rating - 0%
0   0   0
Can I wipe the data history from my reef pi - currently just set up on a breadboard for testing with temp sesors and timers.
I'd like to wipe the cached historic data so that the dashbaord resets and only shows new data, how can I do this?
thanks
 

ColoredRock

Well-Known Member
View Badges
Joined
Aug 9, 2021
Messages
854
Reaction score
1,027
Location
Murrieta, CA (North of San Diego)
Rating - 0%
0   0   0

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
976
Location
Germany
Rating - 0%
0   0   0

ColoredRock

Well-Known Member
View Badges
Joined
Aug 9, 2021
Messages
854
Reaction score
1,027
Location
Murrieta, CA (North of San Diego)
Rating - 0%
0   0   0
Wouldn't that removal of the database file, as described in the Troubleshooting Guide, also remove all settings, e.g. all pH sensors, etc. ?
Before you try that, I would definitely recommend to download a backup of that database.

Great question though, I was wondering the exact same thing !
God.. good catch.. I will blame lack of sleep for not seeing historical data.
 

ColoredRock

Well-Known Member
View Badges
Joined
Aug 9, 2021
Messages
854
Reaction score
1,027
Location
Murrieta, CA (North of San Diego)
Rating - 0%
0   0   0
im not at home to but searching I came up with.. (make sure you back up your database)



reef-pi db is a sub command that can update and retrieve data from the database. You can use it to delete data from specific buckets, which are collections of key-value pairs.

For example, if you want to delete all the data from the bucket named “temperature”, you can use this command:

reef-pi db delete -b temperature

You can also specify a key to delete only one element from a bucket.

For example, if you want to delete the element with the key “1” from the bucket named “ato”, you can use this command:

reef-pi db delete -b ato -k 1

You can find more information about reef-pi db and its options by using this command:

reef-pi db --help

Use at your own risk! this was an AI generated answer to a question.

Going to play with it when I can log into my pi.
 

ColoredRock

Well-Known Member
View Badges
Joined
Aug 9, 2021
Messages
854
Reaction score
1,027
Location
Murrieta, CA (North of San Diego)
Rating - 0%
0   0   0
I tried it on my test system...

Backed up my db
Loaded my backup to make sure it was good

Stop the reefpi service:
sudo systemctl stop reef-pi.service

Check status:
sudo systemctl status reef-pi.service

List buckets:
reef-pi db buckets

I removed my ph history.
sudo reef-pi db delete ph_readings 1

Started the service backup

sudo systemctl start reef-pi.service

Rebooted for good measure.

Historical ph is cleared.
 
OP
OP
waterwombat

waterwombat

New Member
View Badges
Joined
Mar 9, 2023
Messages
2
Reaction score
4
Location
Melbourne
Rating - 0%
0   0   0
Thanks for the responses - I was sort of hoping there was a "reset" option in the web interface, I think that would be a useful feature. looks like I'll have to sort out logging on to the raspi command line to do this.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Thanks for the responses - I was sort of hoping there was a "reset" option in the web interface, I think that would be a useful feature. looks like I'll have to sort out logging on to the raspi command line to do this.
Yes this will be a useful feature across all components (to reset sensor & usage data). Its on my wish list as well :-/
 

Litserv

Community Member
View Badges
Joined
May 3, 2020
Messages
62
Reaction score
60
Rating - 0%
0   0   0
Do you still need help with this ?

I couldn't solve this by myself. For the time being, I have to skip this, because I'm having vacation in some days... ;-)

But in general, a function to delete old recorded data would be nice...
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I couldn't solve this by myself. For the time being, I have to skip this, because I'm having vacation in some days... ;-)

But in general, a function to delete old recorded data would be nice...
You should be able to do this with db subcommand, just delete the right element under usage bucket
 

Tentacled trailblazer in your tank: Have you ever kept a large starfish?

  • I currently have a starfish in my tank.

    Votes: 48 33.8%
  • Not currently, but I have kept a starfish in the past.

    Votes: 37 26.1%
  • I have never kept a starfish, but I hope to in the future.

    Votes: 29 20.4%
  • I have no plans to keep a starfish.

    Votes: 27 19.0%
  • Other.

    Votes: 1 0.7%
Back
Top