Community
OpenEnergyMonitor

Community

Import Backup Issue on new emonPi image

Tags: #<Tag:0x00007f6e156be498> #<Tag:0x00007f6e156be330> #<Tag:0x00007f6e156be268>

Continuing the discussion from emonSD-03May16 Release:

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:


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.

Thanks for letting me know just made a couple [1] [2] 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

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.

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.

1 Like

Don’t you mean "NOW be fixed?

Yes, :slight_smile:. Been fixed. Thanks

@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).

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.

Haste makes waste!

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’/

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

1 Like

Good idea, link and text has been renamed:

Looks good to me, what do you think @Jon

Paul

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).

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

I do like the renaming! Time to update!

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