Upgrading to Dev Branch

Struggling to upgrade emoncms!

I have a Raspberry Pi which was installed with emoncms from scratch (without installing git).

I have since installed git, registered the SSH key, and then entered;

$ /var/www/
$ sudo git clone -b dev git@github.com:emoncms/emoncms.git

I get the response;
fatal: destination path 'emoncms' already exists and is not an empty directory.

TrystanLea's picture

Re: Upgrading to Dev Branch

Hello Paul, If you rename your current emoncms folder to something like emoncmsold and then create and download the new directory from scratch. You should be able to do it without using sudo if you have set the www folder ownership to pi, see step 7 here: http://emoncms.org/site/docs/installlinux

Keeping the old folder intact will allow you to revert to the old version if you need to. Il add a note to the upgrade page.

TrystanLea's picture

Re: Upgrading to Dev Branch

Thinking about it a little more, I think it might be best to clone into a new folder called dev, leaving the current emoncms folder intact so that the upgrade process does not interfere with your current emoncms installation and any hardware posting to it.

I have updated the documentation here: http://emoncms.org/site/docs/upgrading

 

Paul Reed's picture

Re: Upgrading to Dev Branch

That didn't  go well!

I tried the revised guide, but it would not pick up any data feeds. I suspect it was because the RFM2Pi drivers were in the Modules folder of the older emoncms version.  I tried to reinstall the RFM2Pi drivers in the new modules folder, but ended up somehow corrupting the install, so I've restored my SD card to a working backup (older version).

I'm back where I started!

Paul

Bra1n's picture

Re: Upgrading to Dev Branch

I've just struggled through this myself but finally got it all working. I downloaded the updated raspberrypi code from here https://github.com/emoncms/raspberrypi/tree/dev and unzipped it into the /var/www/emoncms/Modules/raspberrypi directory and that part started working. I still had problems with inputs I post using Json from an Arduino with an ethernet shield but then realised the url format had changed from "/emoncms/input/post?time=1364053739&json={Test:999}" to "/emoncms/input/post.json?time=1364053739&json={Test:999}" i.e ".json" needed adding after "/post". 

Robert Wall's picture

Re: Upgrading to Dev Branch

The ".json" in "/post.json" suppresses the HTML page that would otherwise be returned (so it just says "ok")

Bra1n's picture

Re: Upgrading to Dev Branch

Not quite "/emoncms/input/post.json?time=1364053739&json={Test:999}&apikey=YourAPIkey" posts the data and returns "ok" whereas "/emoncms/input/post?time=1364053739&json={Test:999}&apikey=YourAPIkey" doesn't work with the Dev version and just returns the menu banner and footer. No data is posted to the database.

I just tested again to make sure.

To be clear I'm talking about the latest Dev Branch on the RaspberryPi

Paul Reed's picture

Re: Upgrading to Dev Branch

I'm trying to run through the upgrade guide again, and can't help think that at least one of the paths is incorrect in the guide.

I'm presently on to Step 3 - Run Database Update by going to http://localhost/emoncms/admin and logging in. It does not update the database with any new fields (but then why would it - emoncms is the folder of my previous working version).
If I try http://localhost/dev/admin then it will not accept my admin user login.

Step 4 - Run migrate_inputs.php script also details loading http://localhost/emoncms/migrate_inputs.php but of course migrate_inputs.php is not in the emon folder, it's in the dev folder!

Sorry if I'm doing something stupid, I can't get this right.

TrystanLea's picture

Re: Upgrading to Dev Branch

Hello Paul, your quite right, paths are corrected, sorry about that.

TrystanLea's picture

Re: Upgrading to Dev Branch

I realize there is one other step I have missed which might be the issue, the username format has changed to only allow a-z 0-9 underscore and dash. I still need to add a step to the migration script to remove these characters. The format needed to be changed to be compatible with the new routing system and public dashboard names.

 

 

 

Paul Reed's picture

Re: Upgrading to Dev Branch

Successfully updated to emoncms dev!
I can't help thinking that I made hard work of it though...

Jérôme's picture

Re: Upgrading to Dev Branch

Trystan, is it safe to move to latest revisions from dev branch ?

I'm still using commit f04fa6c. Oscar and casestudies had issues with it and as far as I understand they could not go back after database update. Is this solved with latest commits ?

 

I don't want to be alarmist, the status is just unclear to me.

gloorung's picture

Re: Upgrading to Dev Branch

Just upgraded to the dev branch; all went well after reading the previous posts but I'm having one small problem I can resolve: in the input list, the old input names (nodeXX_X) are still there. They no longer generate data, but everytime I try to remove them, they're added again after a couple of seconds. Other than that, everything seems to work just fine.

Any idea what I may have forgotten or done wrong ? 

Paul Reed's picture

Re: Upgrading to Dev Branch

Gloorung, I had the same, and suspect that it may because you have 2 versions of emoncms in the www folder, the old version and the dev version, and the feed processing in the old version is still naming them 10_1, 10_2 etc.

I simple Gzipped up the 'oldemoncms' folder and contents, which of course stopped any scripts from running from it.

$ cd /var/www/
$ tar czf oldemoncms.tar.gz oldemoncms

After zipping up the folder, delete any 'old' feeds and inputs in your updated version and reboot.

If it goes belly up, you can always restore it later!
Let us know if it works for you.

Paul

Jérôme's picture

Re: Upgrading to Dev Branch

Out of curiosity, why don't you use git instead of downloading and ungzipping the archive ?

I find git even simpler. Even if you don't contribute your modifications, you can safely modify anything with a way back.

Paul Reed's picture

Re: Upgrading to Dev Branch

I did, as per my first post above.
I haven't grasped the full benefits to using Git yet, but it did seem simpler to install modules, and presumable to update them if the branch is later updated.

Paul

Jérôme's picture

Re: Upgrading to Dev Branch

Right, sorry.

Then you could commit locally instead of gzipping. But anyway, I'm off-topic.

gloorung's picture

Re: Upgrading to Dev Branch

Hi Paul,

Rebooting solved the problem (even without zipping the old folder). 

Thx,
Roel

 

Jérôme's picture

Re: Upgrading to Dev Branch

BTW, I did update to latest dev revision and whatever issue the others had didn't occur here, as far as I can tell. Seems safe to me.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.