I have been seeking to back-up the emoncms mysql database using rsync, however I am confused as to which database files contain the recorded data. The .frm files haven't changed in weeks, though I can see that the various feeds are busy receiving data; I cannot see any .myi or .myd files either. Please would someone be so kind as to explain exactly where the data is being stored as it is not obvious from the files within . I have searched the forum, though I haven't seen any references to their location - though that may be a case of not seeing the wood for the trees!
I have emoncms installed on a Raspberry Pi running Raspian.
Thank you
David
Re: emoncms mysql data files location
After some more rummaging around, I have noted that the file ibdata1 in the /var/lib/mysql directory is busily growing with a timestamp that reflects current time (currently 85MB on my recently commissioned system). Viewing it using 'more' reveals, amongst the heiroglyphics, some plain English information, such as the feed names. On the basis of the above, I appear to have answered my own question and that this is the mysql datafile for emoncms.
David
Re: emoncms mysql data files location
Hi.
Forgive me if I'm out of topic, but I think the common practice is not to duplicate those hieroglyphic files, but to generate dumps at regular intervals. Dump that can then be saved via rsync.
For instance on our personal server, we added cron jobs to generate dumps then do a little cleanup to keep something like one dump a day for last week, and then one dump a week for last month. I'm not sure we rsync those dumps to another server/computer, though.
Pay a search to keywords "sql dump cron" or such, and you should find useful inputs. If not I can provide a few more hints later.
Re: emoncms mysql data files location
Or using phpMyAdmin you can "Export" the entire database as a SQL file that can be imported if required. You get a very large text file but it will compress very well (to approximately 6-7% of the original size) for storage.
Re: emoncms mysql data files location
Thank you for the feedback.
Ishall look into exporting the MySQL databases, perhaps via an automated process using Cron. I'll also have a careful read of the "data portability" document elsewhere on the forum to see what it recommends.
David
Re: emoncms mysql data files location
See this thread : http://openenergymonitor.org/emon/node/1996