Copy feeds data from earlier emoncms installation to new one

Hi all

I'm after advice on how to copy my old historical feed data from a previous emoncms installation to a new one.

My old installation (still running) is on a private debian server at home. It's running emoncms 8.1.1 and the feeds are PHPFINA and PHPFIWA

I've just installed emoncms 8.5.1XT on a shared linux hosted environment. I've created new feeds running in parallel with the old installation.These feeds are PHPFINA and PHPFIWA. 

I want to copy my old feed data from the private debian server to the shared linux 8.5.1 emoncms. I don't need to merge the data. Although I will have two feeds measuring, say, my total house electric power I am ok to leave them like that rather than try to merge them, which I think is more complex. 

I tried exporting the feeds table from the debian server using phpmyadmin, but when I tried to import it into the 8.5.1 using phpmyadmin again I got the error: #1062 - Duplicate entry '1' for key 'PRIMARY' 

I'm no DB expert but I assume I'm getting a clash of keys. I thought the import process would manage this e.g. labelling the old key 1 as 1_1 or adding it to the end of the count....It seems not.

I've seen Trystan's migrate script, but I'm not sure that's what I'm looking for.....but I am happy to be told it is.

Attached are two screengrabs showing the feeds. In the 8.1.1 emoncms feed1 is for solar PV, whereas in the 8.5.1 installation feed1 is for fridge power. The 8.5.1 installation has 35 feeds at the moment, so important old feed1 and feed 36 would be fine....but how?

Any advice appreciated.

mking007's picture

Re: Copy feeds data from earlier emoncms installation to new one

Quick bump on this. If this is dead easy then I don't mind being told that!

pb66's picture

Re: Copy feeds data from earlier emoncms installation to new one

The feeds are not held in mySQL, they are in the PHPfina and PHPfiwa folders.

If the old feeds are still running and of the same type as the new ones, then you shouldn't need to merge them as any new data is also already in the old feeds.

The feed id is the key, if you look at the feeds table of emoncms on both installs you can see the details of each feed, the feed id is also the file name for both the data file and metadata file in PHPfina or PHPfiwa.

In theory you should be able to copy a folder or each .dat & .meta pair over to your new install and just change the file names to the new id's. if you backup your new feed files 1st and leave the old server running you have nothing to lose but a few data points during the transition.

Paul

Paul Reed's picture

Re: Copy feeds data from earlier emoncms installation to new one

When moving the feed folders, remember to check their permissions in their new location!
See http://openenergymonitor.org/emon/node/6085

Paul

mking007's picture

Re: Copy feeds data from earlier emoncms installation to new one

Thanks

I have moved one feed and it seems to have worked fine. It was PHPFINA on the old server and the new server was PHPFIWA but I've just created a new PHPFINA feed and pointed it towards the copied over file. Seems to have worked fine and I can see my 15MB of historical data. I'll do the others later.

Thanks :D

Comment viewing options

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