One advantage of this usb import approach is that it can in certain cases be used to recover a corrupted SD card were a previous backup archive was not made - or is quite old. If the SD card mounts ok the script may run without trouble, but if the damage is greater, running the file system consistency check utility (fsck) maybe needed before doing an import.
Both Glyn and I had our home systems go down following the same power cut in our village last weekend. While my system booted there were issues with emonhub and redis resulting from SD card corruption. I was able to recover using the importer tool without running fsck. Glyn’s on the other hand would not boot initially - but after running fsck we were able to mount the old SD card and run the import script.
Here are the steps to do this:
1. Insert SD card in SD card reader and plug in to the emonPi/emonbase/raspberrypi running a fresh copy of the emonSD image.
2. Attempt to recover the SD card partitions e.g:
Thanks @borpin I’ve made the changes you suggested. Apparently bookmarks work to any heading, you just need to type the full heading in lower case and with dashes:
also they should be a little more checking, if you click import from USB without the usb the web interface dies with
’ Can’t connect to database, please verify credentials/configuration in settings.php
Error message: Unknown database ‘emoncms’’
OK I just read the code and I think I see that the master hasn’t been updated yet, pending Trystan’s GitHub issue investigation - completely understand why. I assume Paul created his own branch to get it working. I’m not a GitHub user so I might need some help to create my own mod
Thank you Brian! After an initial attempt using Git, I went ahead and did exactly what you suggest about half an hour ago, and the import worked a treat
However, I wouldn’t have known to undo it for future updates to work though - so double-thanks for that. I made a copy of the file first though
It would be nice to know how to have done it properly though, via Git…
I created my own fork, edited it and committed it back to my private repo. Now though, how would I apply the update on the EmonPi in order to test it? And then how would I revert back to the master Emoncms release afterwards?
However because the original clone was done direct from the upstream, it calls itself origin in this case (git doesn’t make anything easy - trust me). We won’t bother creating the link though - it doesn’t matter here. It does matter (a bit) if you are doing development work.
First part right, create a fork. Ideally then create your own branch on that fork - if you subsequently want to create a PR (Pull Request) to submit something you have done to the main emoncms repo, this makes it much easier.
To use your repo, you first need to add it to your local machine in the same directory the original is in.