Recommended upgrade method

I’ve a few days of data (only) using the June 15 sd card image system. I’d like to upgrade to 3 May sd card system. Is there a recommended process for doing this, which minimises down time - or is it a matter of backing up what data I have, re-flashing the sd card, doing any jessie updates, expanding the data partition, and restoring the data and carrying on? I can imagine my system might be down for an hour or two and that I’ll lose the data that would otherwise have been logged during that period. That’s fine if it has to be, but if there is a better way, I’d really appreciate knowing.

What I’ve done pre-emptively is (just now) buy another RF hat from the store which I intend to put on a pi3 I have elsewhere do most of the above whilst logging data in parallel (should work?) with the existing pi, do a backup from old system, restore to new, and carry on. Not certain that is possible, but will try.

The export / import backup module can be used to migrate from the June image. See instructions:

Thanks, Glyn. I thought that may be the way to go. So, it does involve closing down the system for the period after the system is backed up/exported, pi shut down, the sd card reformatted with the new image, system re-booted with new sd card image, ssh into new system, rpi-rw, expand partition, re-boot, import/restore data, and away you go. Am I correct that the Admin->Update Pi (v8.5) process does not update the emoncms software on an emonBase, only the firmware on the emonPi? Are there any plans to introduce an update method from version to version from within the software? Fwiw, I think that would be very useful as it would minimise down time (hopefully). Thanks again. Really like the software.

If you have a second device and sd card you could indeed set up your new image in parallel on the Pi 3 and RFM2Pi and when you are ready do a backup and restore from the old system imediatly before restoring it to the already running new system with almost no down time. I believe the “restore” overwrites any existing data accumulated prior to that.

The emonPi update process does work for the emonBase images too it is just the RFM2Pi doesn’t get it’s firmware updated automatically where as the emonpi add-on boards firmware is.

Yes, would recommend writing the new image to a fresh new card if possible. That way you can easily restore your old setup if there are are problems. If you have the luxury of a second Pi, then yes you could run the two in parallel. See the new User Guide website for the latest setup guide for the new image.

If you’re using an SD card larger then 4gb, be sure to expand the data partition using emonsdexpand (see instructions on the setup/import link above).

Thanks @pb66 and @glyn.hudson. When I use the Admin->Update emonPi button whilst using low-write-v8.5 on my Pi2 + RFM2Pi, it does not update emonCMS to 9.x, which is the current version (as I understand it). It stays at 8.5. I may be making the mistake of confusing ‘update’ and ‘upgrade’?

Here is a log extract:

=================================
Emoncms update started

Sun May 8 09:24:26 UTC 2016

git pull /var/www/emoncms

  • low-write
    Already up-to-date.

git pull /var/www/emoncms/Modules/nodes

  • master
    Already up-to-date.

git pull /var/www/emoncms/Modules/app

  • master
    Already up-to-date.

git pull /var/www/emoncms/Modules/config

  • master
    Already up-to-date.

git pull /var/www/emoncms/Modules/wifi

  • master
    Already up-to-date.
    git pull /var/www/emoncms/Modules/dashboard
  • low-write
    Already up-to-date.

git pull /var/www/emoncms/Modules/graph

  • master
    Already up-to-date.

git pull /home/pi/postprocess
Already on ‘emonpi’
Already up-to-date.
git pull /home/pi/backup

  • master
    Already up-to-date.

Copy new default.emonpi.settings.php to settings.php & make backup old.emonpi.settings.php

Update Emoncms database
[]

Restarting Services…
Restarting OpenEnergyMonitor emonHub: emonhub has been restarted ok.
Log is turned off
Restarting feedwriterJob is already running!

Log is turned off
Restarting emoncms-nodes

Restarting Services…
Checking cron tab for service runner entry…
service runner crontab entry already installed

Start emonPi LCD service
Starting system emonPiLCD daemon:.


emonPi update done
Sun May 8 09:25:42 UTC 2016

mount: you must specify the filesystem type
Filesystem is locked - Read Only access
type ’ rpi-rw ’ to unlock

The differences between the v8.5 images and the current image is vast, I would really recommend starting afresh. Once you are on the newer strain of images the updating will be much easier but first you need to get the tools and software to facilitate that on to the sdcard.

Thanks for this. I’m now using an absolutely clean install from the 9.5 sd card image download. I checked the md5 of the unzipped image. I did try exporting my 8.5 data and importing it back in to the new 9.5 install, but none of the feeds came across, nor the inputs. I didn’t get to check the database entries. 9.5 used new .conf files rather than mine from the earlier installation. I had edited the 8.5 .conf files to remove nodes that I did not have, so that may have caused a blip. Anyway, even when I tried manually editing the .conf files, the feeds page just continuously said, “Loading…” without actually loading the feeds. Having tried with a couple of different sd cards, I’d had no success, so just decided to do a clean install. I’m using a Pi2 with the RF hat from the OEM shop. I re-installed the May 3 image onto a newly formatted sd card. I ran emonSDexpand to make use of the 8GB card. I also did an apt-get update and dist-upgrade. All that seemed to be updated by that was some SSL libraries.

I sorted all the node and input descriptions and set up the feeds anew. The system is not enabling me to enter dashboards. I do not get the Text, Container, Widget etc. buttons - only the Configure and Delete ones. If I press Configure I just get a dialogue with nothing but Cancel and Save buttons. Also pressing the New dashboard button did not work for many attempts.

I also notice that there appears to be no way of updating the system from within the interface that I am seeing. Previously the update button was on the Administration page. On 9.5, I can only see the Users, Update database buttons, and the Logger section - no Update emon button.

I’d be really grateful if someone could advise me if it’s something I am doing wrong or whether these are issues with the software. I want to make this work but can’t see a way through the issues I’m experiencing.

I’ve noticed that some links do not seem to do anything for me: For example, the Edit links and the Change Password links on the My Account page. It feels like my privileges have been rescinded and am not being allowed by the system to do what I should be able to do, but the system is not advising me of as much. If I can post logs etc. or anything else, please let me know.

The laptop I’m linking to the Pi on is a Linux Mint 17.3 machine running Firefox 46.0, which I’m using for the interface to the Pi server.

Thanks in advance.

See After upgrade 2 questions/problems about the admin options working after setting the timezone with raspi-config, I do not know the link or why that is, I just recall the discussion :slight_smile:

The Update button should be on the admin page: http://emonpi/emoncms/admin/view

It sounds like you are using the non emonPi specific settings.php file. The update button is only visible when using an emonPi / emonBase. Please could you post your /var/www/emoncms/settings.php file. It’s very strange that this has happened since the emonPi settings.php file should have been installed by default on the new image. Have you changed the settings file yourself?

Assuming you haven’t got custom changes to the settings.php file you restore the default emonPi settings file with:

sudo cp /var/www/emoncms/default.emonpi.settings.php /var/www/emoncms/settings.php

Thank you @pb66. I’ll try the changes you suggest and will revert.

Thank you @glyn.hudson. The only changes I have made to any configuration settings have been from within the emonhub editing: I just correctly named my nodes and inputs. I’ve not touched any files other than that one, and only that one via the emonhub editing facility on the served web page from the Pi system. I’ve tried to keep the install as ‘clean’ as possible, because of the issues I had trying to export and then re-import. So I started with an absolutely newly imaged sd card and only made the changes in my other post of today describing what I did.

I’ll copy the default settings file over my existing one if the config suggestions made by pb66 do not work. Will that interfere with the changes I made to emonhub conf file?

Before making any changes please post your current settings.php so we can see if this indeed the cause of your problem.

Sorry, I did the timezone specification as suggested above before seeing your post, Glyn. The Update button has appeared! I did an update and watched the output in the purple area. I noticed that it copied the default settings file across as part of the update process. There didn’t appear to be anything updated as the system seemed to be up to date, however.

The dashboard missing buttons didn’t seem to be rectified, though. I tried to create a dashboard and there was only the Configure and Delete buttons again - not Text, Container, Widgets buttons. Any suggestions as to what might be causing that issue?

Should I have posted this under EmonSD, incidentally?

I’ve looked further into this, @glyn.hudson. I’ve set up a second Pi with the same image download (3 May) as its source software image. The first/original Pi is a Pi2 using an 8GB SD card, the one I’ve just installed is a Pi3 with a 32GB SD card, both cards fully ‘expanded’ using emonSDexpand. I didn’t do a raspi-config on the new system. I did on the old system as is documented above. I did a dist-upgrade using apt-get.

The system running in parallel is not experiencing the same issues I had/have with the original system. I still can’t see the dashboard creation buttons on the original system. I can on the new system, but… I notice that when I select to set up a dashboard and press the icon to edit the actual dashboard, the web page serves Configure and Delete buttons just like on the original system but then almost immediately seems to overwrite them with the Text, Containers, Widgets and Visualisations buttons. It’s as if on my original system this overwriting is not happening. The overwriting is almost instantaneous but I can see the Configure and Delete buttons there, just before the other buttons appear in their stead.

I’ve also discovered that the Export and Import facility is not working as I expect it to do. I’m exporting and importing using the same version of the software, don’t forget. I expect the export to export all my inputs names and configuring etc. and then the import facility to import that into the importing system. This is not happening. I have modified my emonhub file on my original system so that the nodes and inputs etc. have names that suit the nodes themselves and I have added a node 11. I’ve also included an api key for writing to emoncms.org server. Whilst this information is definitely being exported (I can view, for example, the emonhub.conf contents from the archive and it looks correct), it is not being imported. The emonhub file is the default one that comes on the SD card image after the import is executed. The upshot is all the node, input and apikey information I had on the original system is lost, until I manually re-make the changes. The changes I made, in case this is useful, are to modify node 10’s content names etc. and adding a node 11 and adding an apikey. It looks like the MySQL Db is being imported okay. If, after doing the import, I manually make a change to the new system’s emonhub.conf file using the editor from the browser interface and save it etc. and then try to import, say a later version of the data from the original system, the data from the export from the original system is not brought across, and the changes I made to the new system’s emonhub file is overwritten once again by the default emonhub.conf contents.

I hope this is of some use. I’m going to continue running both systems in parallel for a while, so if I can be of any assistance with additional information, please let me know.

Sorry you’re still having issues. Please could you break down the issues you are experiencing into separate topics or use bullet points. Sorry, I’m struggling to follow this block of text :confused:

Will do. Thanks.