# Web Based Backup Fails

**URL:** <https://community.openenergymonitor.org/t/web-based-backup-fails/9541>\
**Category:** emonPi\
**Created:** [20 December 2018 07:57 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541 "2018-12-20T07:57:18Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewhf01](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andrewhf01](https://community.openenergymonitor.org/u/andrewhf01)\
**Post date:** [20 December 2018 07:57 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/1 "2018-12-20T07:57:18Z")

</div>

I’m trying to backup my local emoncms, I’ve tried web based and get:

 ![32](https://community.openenergymonitor.org/uploads/default/original/2X/7/7c08047c53042bdea8b198a09bf8006300f717d2.jpeg)

So I then tried SSH as per [Paul B](https://community.openenergymonitor.org/t/backup-emonpi-without-web-server-access/5635/3) on the forum with  
`pi@emonpi(rw):backup$ ./emoncms-export.sh`  
I get:

```
pi@emonpi(rw):backup$ ./emoncms-export.sh
=== Emoncms export start ===
Thu 20 Dec 07:12:23 UTC 2018
Backup module version:
    "version" : "1.1.4"
EUID: 1000
Reading /home/pi/backup/config.cfg....
Location of mysql database: /home/pi/data
Location of emonhub.conf: /home/pi/data
Location of emoncms.conf: /home/pi/data
Location of Emoncms: /var/www/emoncms
Backup destination: /home/pi/data
Image version: emonSD-26Oct17
./emoncms-export.sh: line 74: /home/pi/data/emoncms.sql: Permission denied
Error: failed to export mysql data
emoncms export failed

```

Nevertheless, the SSH backup works when using  
`pi@emonpi(rw):backup$ sudo ./emoncms-export.sh`  
any help appreciated on trying fix web based emoncms backup.

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [20 December 2018 15:35 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/2 "2018-12-20T15:35:34Z")

</div>

Hi @andrewhf01

Try updating to the latest version of the backup module, I see your running 1.1.4. The latest version is 1.1.6. It should update if you run emonPi update (Setup \> Admin \> emonPi update) in local Emoncms

The issue seems to be that the database dump file `/home/pi/data/emoncms.sql` has got root permissions. This could have been caused by the backup module being run as root in the past.

You could try to delete the database dump file then run the web export again:

`sudo rm -rf /home/pi/data/emoncms.sq`

---

<div class="post-metadata">

**Author:** ![andrewhf01](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andrewhf01](https://community.openenergymonitor.org/u/andrewhf01)\
**Post date:** [28 December 2018 08:48 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/3 "2018-12-28T08:48:14Z")

</div>

Hi Glyn,  
I ran the

> emonPi update (Setup \> Admin \> emonPi update) in local Emoncms

just last month but this appears not to have updated, when was the backup module upgraded to 1.1.6?

Andrew

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [28 December 2018 23:18 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/4 "2018-12-28T23:18:22Z")

</div>

> [@andrewhf01](#):
>
> just last month but this appears not to have updated, when was the backup module upgraded to 1.1.6?

Apologies, I just realised that V1.1.6 had not yet been released to the stable branch. It’s been done now 👍

> **[Release V1.1.6 · emoncms/backup](https://github.com/emoncms/backup/releases/tag/1.1.6)**
>
> Fix bug where phptimeseries not being included in archive
> Add export to USB backup script

---

<div class="post-metadata">

**Author:** ![andrewhf01](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andrewhf01](https://community.openenergymonitor.org/u/andrewhf01)\
**Post date:** [5 June 2019 12:44 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/5 "2019-06-05T12:44:55Z")

</div>

Hi Glyn,  
just got round to updating the emonpi and the backup etc. now running backup 2.0 and still will not backup using web based backup. Nevertheless, I managed to manually backup to pi/data/emoncms-backup-2019-06-03.tar.gz, I’ve tried SSH using:

```
sudo scp pi@192.168.0.40: ~/data/emoncms-backup-2019-06-03.tar.gz /Volumes/User_Data/andrewfindlow/Desktop

```

but I’m struggling trying to copy tar files any ideas how I can transfer this file?  
Just need to get this file on to my desktop computer so that I can do fresh install of emonpi and upload all the inputs and feeds etc.  
Any help would be most appreciated.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [5 June 2019 14:02 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/6 "2019-06-05T14:02:55Z")

</div>

> [@andrewhf01](#):
>
> but I’m struggling trying to copy tar files any ideas how I can transfer this file?

WinSCP is a good tool.

---

<div class="post-metadata">

**Author:** ![andrewhf01](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andrewhf01](https://community.openenergymonitor.org/u/andrewhf01)\
**Post date:** [5 June 2019 15:37 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/7 "2019-06-05T15:37:41Z")

</div>

> [@borpin](#):
>
> WinSCP

I use a Mac OSX

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [5 June 2019 16:09 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/8 "2019-06-05T16:09:01Z")

</div>

> [@andrewhf01](#):
>
> I use a Mac OSX

What error do you get?

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [5 June 2019 16:14 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/9 "2019-06-05T16:14:42Z")

</div>

> [@andrewhf01](#):
>
> I use a Mac OSX

@Jon Can you help?

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [5 June 2019 16:24 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/10 "2019-06-05T16:24:49Z")

</div>

> [@andrewhf01](#):
>
> ```auto
> sudo scp pi@192.168.0.40: ~/data/emoncms-backup-2019-06-03.tar.gz /Volumes/User_Data/andrewfindlow/Desktop
> 
> ```

Are you running this command in the SSH session connected to the Pi, or a local terminal window? i.e. are you trying to pull the file or push it?

In a terminal on the local machine use `sftp` so

```auto
sftp pi@192.168.0.40

```

Then type `help` (commands like pwd, cd, etc are the same). Use `get` to get the file.

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [5 June 2019 17:04 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/11 "2019-06-05T17:04:35Z")

</div>

Hi @andrewhf01  
I run MacOS and use **CyberDuck** to transfer files to and from my emonPi. It is easy to use!  
[https://cyberduck.io/download/](https://cyberduck.io/download/)

There are many other SFTP transfer applications.

@borpin looks like he has the right idea. I’ll give that a try later today.

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [5 June 2019 18:50 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/12 "2019-06-05T18:50:50Z")

</div>

I think the issue is an extra space before the tilde “~”.

The command to transfer from an emonPi to a Mac is done via your local computer (your Mac).

The first password is your Mac login. The second password is for the emonPi.

Open Terminal on your Mac and enter:

```auto
sudo scp pi@192.168.60.230:/home/pi/data/emoncms-backup-2018-02-07.tar.gz /Users/jon/Desktop

Password: (this is your Mac user password)
pi@192.168.60.230's password: (this is your emonpi password)

emoncms-backup-2018-02-07.tar.gz 100% 135MB 7.4MB/s 00:18    

```

Hope this helps!  
Jon

---

<div class="post-metadata">

**Author:** ![andrewhf01](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andrewhf01](https://community.openenergymonitor.org/u/andrewhf01)\
**Post date:** [6 June 2019 20:45 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/13 "2019-06-06T20:45:14Z")

</div>

Hi Jon,  
Thanks for the info, I’ll try CyberDuck to transfer files at some point in the very near future.

At present I’m imaging the old SD card before I do anything else then I’m going to try accessing the drive with these backup files directly (I have Paragon extFS) then I can try uploading my old Emoncms data to the new installed emonpi, which I’m having issues with connecting via wifi as per [WiFi connection issues](https://community.openenergymonitor.org/t/wifi-connection-issues/9453)

So, I’m using the wired ethernet connection and will try and fix each of the issues and glitches throughout this upgrade to get it functioning the same, prior to the system crash at the beginning of last month that necessitated the the overhaul.  
Not played with this kit for some while therefore, need to refamiliarise myself and improve my knowledge as well.  
Many thanks  
Andrew

---

<div class="post-metadata">

**Author:** ![andrewhf01](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andrewhf01](https://community.openenergymonitor.org/u/andrewhf01)\
**Post date:** [10 June 2019 21:00 UTC](https://community.openenergymonitor.org/t/web-based-backup-fails/9541/14 "2019-06-10T21:00:54Z")

</div>

Hi Jon,  
Long story, short, it’s all hopefully sorted now.  
Still had problems with web based backup (import and export) however, I managed to get CyberDuck working and downloaded last backup but tar.gz file was corrupt so managed to make one from all the files that supposed to be backed up manually using CLI

> tar -zcvf test3.tar.gz ./

test3 being the filename. Transferred the file to

> pi@emonpi:~/data/uploads

then

> pi@emonpi:~/backup $ ./emoncms-import.sh

was then pleased to see:

> === Emoncms import complete! ===

Sorted my WIFI issues by editing

> sudo nano /etc/wpa\_supplicant/wpa\_supplicant.conf

to

> network={  
> ssid=“yourSSID”  
> scan\_ssid=1  
> psk=“Your\_wifi\_password”  
> }

which allowed me to connect to my WIFI network and I could then see setting in web based EmonCMS WIFI tab.

Tried to get to edit src.ino file to set emonpi voltage calibration then import the firmware via platformio (which I have done successfully in the past) using the firmware from

> <https://github.com/openenergymonitor/emonpi/tree/master/firmware>
>
> //github.com/openenergymonitor/emonpi/tree/master/firmware

This git page only shows emonpi firmware version 2.9.0, which did not work i.e. a the inputs and feeds on all the other nodes stopped working. That used in the EmonCMS web based firmware update is the most up to date 2.9.1 version; using this version and update method got the inputs and feeds all back to normal etc. Is there anyway that git version for clone/download can be updated to 2.9.1?

Therefore, I used the work-around suggest by Robert in

> [EmonPi - accuracy of new install - calibration required?](https://community.openenergymonitor.org/t/emonpi-accuracy-of-new-install-calibration-required/8945)

> Now for the adjustment: you can edit emonhub.conf in your web browser. You’re looking for this section:

```auto
[[5]]
    nodename = emonpi
    [[[rx]]]
        names = power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulsecount
        datacodes = h, h, h, h, h, h, h, h, h, h, L
        scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
        units = W,W,W,V,C,C,C,C,C,C,p

```

> Change the 4th item in `scales = ...` so that the emonPi shows the correct voltage according to your meter. So “0.01” might end up as “0.0105”, etc

and incidentally 0.01049 was the value for my emonpi.

All is good so far.  
Many thanks for all the help.
