Importing data from non emoncms system

I am finally getting around to replacing my several years old, homebrew monitoring setup (based on a wild mix of 1-wire, Jeenodes and off the shelf 433MHz thermometers).

Would be good having a more widely supported base to build on, rather than hacking everything myself - thus considering emoncms.

Anyway, I have a few million data points I'd like to import from the old system. It's already in MySQL, and my question is how to best go about migrating the data to the emoncms db.

The emoncms db schema doesn't look too complicated, but the devil is in the details...

Any pointers to more info on this, or general suggestions on what to keep in mind? Any description of the db model somewhere?

 

many thanks,

Göran

TrystanLea's picture

Re: Importing data from non emoncms system

Hello Goran, that's a topical question, did you see my latest blog posts? what form is your feed data in?

In emoncms, each feed has a seperate table: feed_1, feed_2 etc

The table has two fields: | time INT UNSIGNED | data float | , the time is Indexed.

Time is a unix timestamp.

You also need to register the feed in the feeds table and feed_relation table.

If you can export your present data in CSV similar to this export implementation: http://openenergymonitor.blogspot.com/2012/09/data-portability-exporting-feed-data.html

Im currently writing the import utility that will manage the registering the feed in the feeds table and feed_relation table.

 

 

mountaindude's picture

Re: Importing data from non emoncms system

My data is in a MySQL db, after digging around in the emoncms db a bit it looks like getting my data in there should be be close to trivial. Nice writeup of the CSV exporting, btw.

TrystanLea's picture

Re: Importing data from non emoncms system

Great and thanks!

string158's picture

Re: Importing data from non emoncms system

Hi,

 

Im also trying to import data from an existing database.  Can you explain what you mean by:

You also need to register the feed in the feeds table and feed_relation table.

 

How would I do that?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.