Community
OpenEnergyMonitor

Community

Backup EmonPI without web server access

backup
Tags: #<Tag:0x00007f16b6f32e00>

(Paul Bendall) #1

Would someone be able to guide me through the process of backing-up my config without access to the web server just the CLI?

I’ve been having a few issues and decided to take the plunge and upgrade to the latest image. However, prior to doing this I would like to backup my local settings so I can import them on the new image. Unfortunately one of the recent updates, probably rpt upgrade rather than emonpi itself has knocked out the web server interface. I do still have access via ssh

Many thanks

Paul


(ian) #2

Hi

Have a look here:-1:

There are a number of scripts one of which should suit you with maybe minor edits.

I have used WinSCP to access my emon set up.
This gives you access to all the files. You can then copy the backup file you create with the backup script.

Ian


(Glyn Hudson) #3

Hi @PaulB,

The emonPi can easily be backed up using the Emoncms backup module that is is pre installed on the emonPi (Setup > Backup). This creates a .zip file with all your data and settings backuped up that can easily be restored on another emonPi. See:


(Paul Bendall) #4

@glyn.hudson and @ian thanks for your help and advice. I think I’ve worked out how to do it using the new WSL (Windows Subsystem for Linux) implementation on Windows 10 to give Ubuntu Bash and interoperability.

For the benefit of others (and possible myself in the future)
Install WSL using this guide - https://msdn.microsoft.com/en-us/commandline/wsl/install-win10
From Ubuntu Bash on ssh to the emonpi assuming default username and emonpi is resolvable on your LAN

ssh [email protected]

Enter user pi password (default emonpi2016)
change to backup directory

cd backup

Run the export script

./emoncms-export.sh

The export process takes some time to complete, first copying the files and the compressing. Once complete make a note of the export file location it should be something like /home/pi/data/emoncms-backup-2017-11-24.tar.gz

Exit the ssh session and return to the local machine

Use the Linux command scp to copy the export file from the emonPi to a local directory on the Windows 10 machine (note as we are effectively in a Linux shell case sensitive needs to be honoured even on the Windows filesystem)

scp [email protected]:/home/pi/data/emoncms-backup-2017-11-24.tar.gz /mnt/c/Temp

The command above uses scp in the bash interface to copy the export file from EmonPI to a folder (Temp) on the local Winodws 10 machine.

If all goes to plan then you have the export file on your Windows 10 machine ready to import on your next EmonPI


(Anthony Vassallo) #5

Just a note for the benefit of those that run their browser on a different machine to the emonPi - the menu backup from “settings” didn’t work for me. I had to ssh into the Pi (actually an emonHub) and run the export script in the backup directory, then scp the archive back to my linux desktop.


(Greebo) #6

Can you post your emonBase server details?
I’ve regularly used the Settings -> Backup item and my Pi is headless so I must use a browser on a different machine.