Export data feed from 9.7 | 2016.05.25 (web hosted) to newer PI-hosted version

Hi to everyone :slight_smile:
I have an old version 9.7 | 2016.05.25 hosted on altervista since 2016 and now I would like to export some data feed to a newer version (pi-local).
I don’t have backup section but I can access via FTP to directories data.
How can I migrate my feed? :frowning:

Hello @Ale_Colo you could try the USB import tool documented here to import the old data, this is designed to work with older images and pull in the right files: Update & Upgrade - Guide | OpenEnergyMonitor

Hi TrystanLea, I’m very glad to read your answer :slight_smile:
I don’t have an sd card because it’s hosted to altervista provider.
I have access via web or FTP.
Via ftp all feed datas are stored in files called phpfinaxx.dat and phpfiwaxx.dat.
I can export my feeds data via EmonCMS webUI in CSV format.
Is there any solution?

Thank you
Alessandro from Italy

Hello @Ale_Colo

Assuming your local system is based on the latest emonSD image, here are the main steps I think:

You can copy the phpfina and phpfiwa folders to your Pi, place them in /var/opt/emoncms/phpfina and /var/opt/emoncms/phpfiwa.

Then export your MYSQL database and import in place of the database on the pi. These are the steps to take on the pi itself (not the export part!):

mysql -u emoncms -p emoncms (password: emonpiemoncmsmysql2016)
DROP DATABASE emoncms;
CREATE DATABASE emoncms; 
mysql -u emoncms -p emoncms < import-database-name.sql

Update the database:

php /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php

You might be able to manually run the export script GitHub - emoncms/backup: emoncms backup module. You will need to edit the config file I suspect.

Hi, finally now I tried to make this migration!
I was not able to export via mysql and then I used the “useful scripts” (backup.php, very easy to use :slight_smile: )
Now I have 6 feed, 3 are phpfiwa, when I try to convert with script “phpfiwa_to_phpfina.php” I reveive this error… what I’m doing wrong? I want to keep my feed started in 2015 :frowning:
Same error if I “Create a new feed or replace”… I’m going crazy :frowning:

---------------------------------------------------------------------------------------------------------------------------------------

pi@emonpi(rw):convertdata$ sudo php phpfiwa_to_phpfina.php
---------------------------------------------------
PHPFIWA to PHPFINA conversion script
---------------------------------------------------
Is your setup a standard emonpi or emonbase? (y/n): y
There are 3 feeds to convert, would you like to continue? (y/n): y
23 Volts_Nord
- Create a new feed or replace? (enter 1:new, 2:replace) 1
error opening phpfiwa meta file to read

(Edited for format - RW)

The meta file is the MySQL file. Did you damage/destroy that file when you tried to export via MySQL?

File permissions?

I’m not skilled with linux, I gave to the directory phpfina and files chmod -R 777. The files have -rwxrwxrwx but I receive the same error :frowning:
I have to change permissions to another files?

I imported datas from old emoncms (webhosted) to new emoncms via usefulscript. I don’t think that’s damanged because the phpina feed imported are shown correctly and phpfiwa not…

That indicated that there was a problem with the meta file. It was a suggestion for something to check.

The format of each file is explained in the ‘Learn’ section, so reading that and looking at the script might give you a clue to where to look next.

If that does not help, I think Trystan Lea designed the file format and wrote the script, so he should be able to help you.

This error is only generated on the script trying to open the file. Either it didn’t find it or the permissions are wrong.

it is looking for the files in $sourcedir = "/var/lib/phpfiwa/"; - is that where they are?

The EmonSD image no longer uses the rw/ro options - is this an old image. If so that is your issue I suspect.