Community
OpenEnergyMonitor

Community

Cannot see any feed data after executing backup.php to migrate data from emoncms.org to local emoncms

backup
emoncmsorg
emoncms
Tags: #<Tag:0x00007f1fe45606c0> #<Tag:0x00007f1fe4560580> #<Tag:0x00007f1fe4560440>

(jvda) #1

I have installed emoncms locally (= my raspberry pi) using the following instructions: https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/jessie.md

Then I have used the backup.php script (https://github.com/emoncms/usefulscripts/blob/master/backup/backup.php) to migrate data from emoncms.org to my local emoncms installation.

When consulting my local Inputs and Feeds I see that they get updated as expected but I can not find any feed data. When I want to see some feed data by clicking on the eye I get an error like this:

Request error {“success”:false,“message”:“Error reading meta data feedid=106091”}

Note also that my /var/log/emoncms.log is filled with the following warnings:

2018-06-12 20:57:06.785|WARN|PHPFina.php|post() failed to fetch meta id=66025
2018-06-12 20:57:06.788|WARN|PHPFina.php|get_meta() meta file does not exist ‘/var/lib/phpfina/174527.meta’
2018-06-12 20:57:06.788|WARN|PHPFina.php|post() failed to fetch meta id=174527
2018-06-12 20:57:06.789|WARN|PHPFina.php|get_meta() meta file does not exist ‘/var/lib/phpfina/184672.meta’
2018-06-12 20:57:06.789|WARN|PHPFina.php|post() failed to fetch meta id=184672
2018-06-12 20:57:06.790|WARN|PHPFina.php|get_meta() meta file does not exist ‘/var/lib/phpfina/65412.meta’
2018-06-12 20:57:06.790|WARN|PHPFina.php|post() failed to fetch meta id=65412

I also see that folder /var/lib/phpfina is empty, so I guess that the backup.php didn’t do everything what it should do.

Maybe it is because I didn’t change $local_emoncms_userid in the backup.php script as I have no clue which id I should take.

So how can I fix this ?

Any help would be much appreciated.
Jan.


Emoncms.org billing
(George (aka Costas the coder)) #2

I suspect you have a problem with file ownership and I noticed a similar issue.

Check this for a fix Emoncms.org billing


(jvda) #3

I managed to fix the problem by the following steps:

A. I undid all changes made by previous calls of the backup.php by means of following steps:

  1. stopped apache server : sudo systemctl stop apache2

  2. emptied the folders /var/lib/phpfina and /var/lib/phptimeseries

  3. dropped all mysql tables in emoncms database (I guess that actually not all tables must be dropped)

  4. reset $local_emoncms_userid to 1 in backup.php script

  5. sudo redis-cli FLUSHALL

  6. restarted apache: sudo systemctl start apache2

  7. logged on to emoncms ( http:192.168.1.131/emoncms ) and registered account => this also recreated all required mysql tables !!

B. Re-executed the backup.php script but this time with sudo !

  1. stopped apache : sudo systemctl stop apache2

  2. sudo php backup.php

  3. change owner and group of all files in folders /var/lib/phpfina and /var/lib/phptimeseries to www-data:root by the command sudo chown -R www-data:root /var/lib/phpfina /var/lib/phptimeseries

  4. sudo redis-cli FLUSHALL

  5. restarted apache :sudo systemctl start apache2

So this correctly migrated all feeds from emoncms.org to my local emoncms installation.
FYI the permissions of the php folders:

drwxrwxrwx 2 www-data root 12288 Jun 14 20:54 phpfina
drwxrwxrwx 2 www-data root 4096 Jun 4 22:53 phpfiwa
drwxrwxrwx 2 www-data root 4096 Jun 14 20:53 phptimeseries


Migrate multigraphs from emoncms.org to local emoncms installation
Emoncms.org billing