# Import Backup Issue on new emonPi image

**URL:** <https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309>\
**Category:** emonSD\
**Tags:** import, backup, emoncms\
**Created:** [9 May 2016 20:10 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309 "2016-05-09T20:10:00Z")\
**Posts on this page:** 15\
**Page:** 1

<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:** [9 May 2016 20:10 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/1 "2016-05-09T20:10:01Z")

</div>

Continuing the discussion from [emonSD-03May16 Release](https://community.openenergymonitor.org/t/emonsd-03may16-release/145):

Can the Import Backup routine delete files that cause an error (e.g., “Sorry, there was an error uploading the file”)?

**Details** - TL;DR  
During my migration to the emonSD-03May16 image I stumbled across an issue. I clicked **Create Backup** (Setup \> Backup \> Export \> Create Backup) and had downloaded the emoncms-backup-2016-05-06 file. In my haste I had download the **tar** file instead of the **tar.gz** file.

With the new SD Card inserted and the new image running I clicked **Import Backup** (Setup \> Backup \> Import \> Import Backup) with the tar file and it failed with this error:

 ![](https://community.openenergymonitor.org/uploads/default/original/1X/96c7d1adc5090318f967428fa3366d28d9bd6757.jpg)  
I realized my error, plugged in the old SD Card, created a new backup file and download the correct emoncms-backup-2016-05-06.tar.gz file.

With the new SD Card inserted (again) and the new image running I ran the **Import Backup** with the proper tar.gz file. **It didn’t work!** I think the emonPi spit out a similar error.

I found the error was caused by the original tar file, emoncms-backup-2016-05-07.tar, was still available in the /home/pi/data/uploads directory. I’m not sure if the upload routine was finding the tar file first or if I used up all the available data space in the /home/pi/data area.

Once I deleted the emoncms-backup-2016-05-07.tar then all worked OK and the tar.gz loaded as expected.

---

<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:** [10 May 2016 01:05 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/2 "2016-05-10T01:05:50Z")

</div>

Thanks for letting me know just made a couple [[1]](https://github.com/emoncms/backup/commit/9a79edfdd0ab10a5e5b320fcd504db2c0b05375b) [[2]](https://github.com/emoncms/backup/commit/8ad0acabf88f79af9b4f8ea97b4fc625bc8a4027) of changes to the backup module and scripts to make it ignore .tar files. Seems to work OK for me. I’ll do some more testing tomorrow.

If you get a chance could you confirm that this fixes this issue for you, once you have updated.

Cheers

---

<div class="post-metadata">

**Author:** ![peter](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/peter/32/2749_2.png) [@peter](https://community.openenergymonitor.org/u/peter)\
**Post date:** [11 May 2016 07:32 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/3 "2016-05-11T07:32:22Z")

</div>

While recovering from the update issue mentioned in the release thread (V2.6 firmware is no go with my older emonTX) I did a backup while rebuilding the micro SD card. That was OK but the restore via the web interface did nothing. Chrome, SSL with various adblockers, if that matters. The upload zips along, pardon the pun, but then the web page refreshes blank-ish and nothing happens.

A manual restore worked, luckily.

Anything I can do to gather more info, preferably non-destructively? I can take a new backup and try that with an anticipated loss of a few minutes of data if required.

---

<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:** [11 May 2016 11:59 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/4 "2016-05-11T11:59:47Z")

</div>

Hi Peter, thanks for reporting the import issue. This should now be fixed. After an update and a restart you should be able to import via the web interface. It was a permissions error.

---

<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:** [11 May 2016 12:17 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/5 "2016-05-11T12:17:12Z")

</div>

> [@glyn.hudson](#):
>
> This should not be fixed.

Don’t you mean " **NOW** be fixed?

---

<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:** [11 May 2016 12:25 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/6 "2016-05-11T12:25:13Z")

</div>

Yes, 🙂. Been fixed. Thanks

---

<div class="post-metadata">

**Author:** ![Thelmike](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/thelmike/32/13997_2.png) [@Thelmike](https://community.openenergymonitor.org/u/Thelmike)\
**Post date:** [16 May 2016 18:03 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/7 "2016-05-16T18:03:20Z")

</div>

@Jon You probably downloaded to a Mac. I too experienced that MacOS X will try to extract the files you download. Gunzip is no problem, but ‘untar’ is not done after that. So that’s why you seem to have received a tar file…

So to resolve this go to Terminal and gzip the file again (type 'gzip ’ and drag the file from the finder window to the terminal window and hit enter).

---

<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:** [16 May 2016 20:04 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/8 "2016-05-16T20:04:02Z")

</div>

Michiel - Good tip - I’ll have to try the gzip! Yes I am using a Mac. Last time I quickly clicked on the **Download Backup** link instead of right clicking and then picking the **Download Linked File**.

![](https://community.openenergymonitor.org/uploads/default/original/1X/ba7e94e9248d09382c2efcd10fd1b7b91c5b850a.png)

Haste makes waste!

---

<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:** [16 May 2016 21:56 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/9 "2016-05-16T21:56:53Z")

</div>

Is this normal operation on a Mac? Safari browser only? Or would it affect Chrome chrome on a Mac? Sorry if it’s a silly question, I’ve never used a Mac!

Do you think I should I add to the user guide including your screen grab to instruct Mac users to ‘Download Linked Files’/

---

<div class="post-metadata">

**Author:** ![Paul](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/paul/32/28_2.png) [@Paul](https://community.openenergymonitor.org/u/Paul)\
**Post date:** [16 May 2016 22:10 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/10 "2016-05-16T22:10:40Z")

</div>

I havent got a emonPi, and am working from Jon’s screenshot above…  
…but IMO the name of the download hyperlink should be be changed from something that suggests clicking it will initiate a download (Download backup), to something more familiar with ‘right click - download’ such as a timestamp - ‘160516\_1830’.

Paul

---

<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:** [16 May 2016 22:28 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/11 "2016-05-16T22:28:20Z")

</div>

Good idea, link and text has been renamed:

![](https://community.openenergymonitor.org/uploads/default/original/1X/849435c1629384044978604e766c288dbdac8f9c.png)

---

<div class="post-metadata">

**Author:** ![Paul](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/paul/32/28_2.png) [@Paul](https://community.openenergymonitor.org/u/Paul)\
**Post date:** [16 May 2016 22:30 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/12 "2016-05-16T22:30:58Z")

</div>

Looks good to me, what do you think @Jon

Paul

---

<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:** [16 May 2016 23:13 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/13 "2016-05-16T23:13:07Z")

</div>

Glyn - It is a Safari thing. FF and Chrome download as a tar.gz. Safari downloads the file, removes the compression, and saves it as a tar.

To turn off that feature, the User would need to turn off the **"Open “safe” files after downloading** in the Safari Preferences (under Safari \> Preferences \> General).

![](https://community.openenergymonitor.org/uploads/default/original/1X/eae1ae93a7a2e9fc862f3721a2aa57b50bf22d11.png)

Or just do the right click/control click **Download Linked File** (as above).

---

<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:** [16 May 2016 23:14 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/14 "2016-05-16T23:14:01Z")

</div>

I do like the renaming! Time to update!

---

<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:** [16 May 2016 23:42 UTC](https://community.openenergymonitor.org/t/import-backup-issue-on-new-emonpi-image/309/15 "2016-05-16T23:42:14Z")

</div>

The **Right Click \> Download** may be confusing to most users since it only applies to Safari.
