OpenEnergyMonitor Community

Accidentally deleted local account on emonBase

Hi all.
Please help me. I am using EmonCMS over 5 years. I am using local installation on emonBase.
Today I wanted delete my account on, because I stopped using it some years ago.
What was very bad surprisse, I deleted my local account.
Is there some way, how to restore local account? Or all my 5 years of work is gone?
Is emonBase continuing loging data after acount deletion?

Thank you in advance for any help.


I think this is something that @TrystanLea can help with.

Hello @ksebelik unfortunately this sounds like you will have lost your local account data, did you see the window listing the data that would be deleted? I can see that this could be unfortunately easy to do if you have both the local and remote tabs open in a browser, I feel your pain/frustration!!

I don’t know the structure of the data on the SD Card - my thought was that if emonCMS had not restarted and no files had been written to the card, the data might still be recoverable even though the directory entries had been freed.

Yes good point, I dont know enough about lower level file recovery to be much help on that, I know there are tools to recover images etc but Im not sure how much luck there would be with data files? and then recovering file names… and mysql data entries?

My problem is I thought the structure was no longer quite what’s written in “Learn” - and I don’t know where the file locations are published anyway, nor what the file names are.

In my experience with spinning discs, if the file itself can be recovered - even in segments, it normally comes down to an inspired guess to put the segments in the correct order and another guess, based on knowledge of what the file name might be, to rename it to be usable. I’ve never needed to do it (yet!) with solid state memory. The danger with that of course is any wear-levelling mechanism can interfere, especially if data has been written since the deletion.

1 Like

Sure, yes, lets say for data files it could be:


with two files like these for each feed…

And presumably the .meta is a fixed size, so should be readily identifiable from that? Even if it’s been lost, could it not be recreated knowing what the feed was? If the (approximate) time of deletion is known, then can the starting time be calculated knowing the data file size and probable last entry time?

It all sounds very messy, but with enough knowledge of what was there, it might just be feasible to recover some of the data.

I think the first thing I’d do is image the card and load the image in another machine, and work on that.

Hi Trystan,
thank you for response.
I installed new image 2021 on other biger SD card and import last backup. So I have lost 20 days “only”. What is good, the new image is far better then my very old from 2016!
So I am running again.
I have made some research on the older SD card.
I suppose the series data files should be in /home/pi/data/phpfina directory. Am I right?
It is empty!
/var/opt/emoncms/phpfina/ directory is for new image.
Next question is - is it standard behavior, when account is deleted, all the data is also deleted?
When I chose delete the accout (I thought it is account, because I used passwor for this account, not for local account), there were only message, the account will be deleted permanently. Nothing about deleting all data.

So I highly recomend to change this dialog. Bold red text - If you will continue, ALL your data will be permanently deleted!!!

Have a nice day.


Hello Karel

Yes the data files on the old image wouuld have been in /home/pi/data

Did you see this dialog and the red button next to the userid? You mentioned being on a 2016 image, I think the ability to fully delete an account might be more recent than that…

Hello Trystan,
if I remember correctly, feed list did not apeared.


Ok, maybe it was an older implementation without the detailed list, Im not entirely sure what would have been on your version. What feed engines are your feeds?