Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Migration from standalone emoncms to emonpi

I have an older standalone emoncms instance running 10.2.5 that I am considering migration over to emonpi. The problem is in migrating my data and configs.

The older version doesn’t seem to have the backup module, and installing it would require quite a few changes from what I can see (like installing emonscript). Has anyone written a standalone script that can generate a backup that can be used by the emonpi importer? I could probably reverse-engineer something by digging through the backup file that emonpi generates, but I would rather not have to do that unless I absolutely have to.

Thanks!

EDIT: This may be as simple as creating a tar made from a mysql backup of the existing database, the php* directories from the data on the old server, and the settings.ini and emonhub.conf from the emonpi. I may just give that a chance, since in the worse case I can just reimagine the emonpi.

FWIW, my idea worked! I did the following on my old server:

  • cd to the directory with my php data files (/var/lib in my case)
  • Dump my database: mysqldump -u emoncms -p -r emoncms.sql emoncms
  • Copy emonhub.conf and settings.ini from the pi: scp [email protected]:/opt/openenergymonitor/emonhub/conf/emonhub.conf . && scp [email protected]:/var/www/emoncms/settings.ini .
  • Create the backup tar: tar zcvf /tmp/emoncms-oldserver-2021-06-28.tar.gz emoncms.sql emonhub.conf settings.ini phpfi* phptimeseries/

I just need to make sure everything is working, then I can do this again and point my collector (btmon) at the new server.

1 Like

Good to hear that you got this working, that sounds about right! great!