I was running ver 9.?.? and, via th web interface dropdown Backup, I exported my data.
I then did an update which installed ver 10.1.2
But I can find nothing on the new web interface that now allows me to import what I had previously exported.
In the Guidance section there is reference to running a script emoncms-iimport.sh but I cannot find this file.
This is all the more strange ā¦
I have another instance of an emoncms/RPi running on the site which I upgraded from ver 9.?.? to 10.1.2 a few days ago.
No problem there - the Backup module is available on its web interface and emoncms-import.sh is available in its directory /home/pi/backup.
I suspect the problem maybe related to this in the emonpiupdate log:
modified: stretch/rc.local
no changes added to commit (use "git add" and/or "git commit -a")
error: Your local changes to the following files would be overwritten by merge:
stretch/rc.local
Please commit your changes or stash them before you merge.
Aborting
I needed to modify rc.local when running ver 9.?.? because of then well known/much discussed log problems (on this Forum)
This mod is no longer required.
So how to revert to a ākosherā/official rc.local that does not throw an error when updating to ver 10.1.2?
@borpin
Thereās a directory /home/pi/data/mysql/emoncms but when I try to cd to it I get Permission denied.
Thereās a directory /home/pi/emonhub so I tried yr suggested commands in that directory and finally ended up with the message ā¦ Already up to date
I want the 10.1.2 update to overwrite the previous rc.local.
The update log says it will not do this
My question is how to force it to overwrite rc.local?
Please commit your changes or stash them before you merge.
Wouldnāt stashing the changes, then updating let the update process overwrite the old rc.local file?
Iām not well-versed in Git, so may be way off-track hereā¦
Yes but it shouldnāt be necessary now and it would mean youād ned to do it every time. If you wanted to, the commands would be git stash before the update and git stash pop afterwards. That can though cause issues and generally I tend to put folk back to a vanilla git repo so there are no further issues.
@borpin
Iāve tried the Git commands youāve suggested in /var/www/emoncms but it did not solve the problem.
Update to 10.1.2 is still refusing to overwrite stretch/rc.local and Server information shows emonhub as failed.
Should I cd to /home/pi/emonpi/stretch directory and try your suggested Git commands there?
You are on the right path, it is the emonpi repo not emoncms that maintains the rc.local file. You could cd to the /home/pi/emonpi/ folder and run Brianās commands from there.
Alternatively you can specify the working directory path in the git command using -C /path/to/repo immediately after git but before any sub-command for example, in this instance I would use
git -C /home/pi/emonpi checkout -f -B master
to force a git checkout of the master branch, resetting it in the process. This command can be run from anywhere as it defines the repo path.
Indeed, the āmasterā would need to be swapped out for whatever branch you are targeting, as would the path need changing to the repo in question. The command was for use āin this instanceā but should work fine for any repo or branch combo.
The reset hard command works no matter what the current branch is and there is a risk that someone could take the checkout command and use it out of context. TIMTOWTDI.
Which is exactly why I never use it! Itās a bit of a sledge hammer to bang in a tack. Iāve lost valuable work in other branches due to using reset without fully appreciating the potential outcome. When the issue is that changes to a specific branch cannot be pulled in due to some changes in said branch the better approach (IMO & of course YMMV) is to remove the changes to that branch that prevent that branch from updating. For the record I cringe each and every time you tell users to fully reset the whole repo without even asking them if they have anything of value in any other branch but I refrain from commenting as hopefully very few users will have changes in other branches and we all have different ways of doing things.
I have simply offered up an alternative, whilst, I have to point out, also saying your commands could still be used (despite my reservations), thatās all it is, an alternative, more appropriate in some scenarios, not so much in others. The important thing here was a) getting the right repo and b) you do not need to navigate to it.