Skip to content

Latest commit

 

History

History
112 lines (59 loc) · 4.03 KB

Upgrading.md

File metadata and controls

112 lines (59 loc) · 4.03 KB

Upgrading

1) Backup

Start by making a backup of your emoncms data and emoncms application folder.

To export a backup of your emoncms mysql data:

mysqldump -u root -p emoncms > emoncms_backup.sql

Or if you have a lot of feed data stored in mysql, you can export the meta data only with:

mysqldump -u root -p emoncms users input feeds dashboard multigraph > emoncms_backup.sql

You can make a direct directory copy of the /var/lib/mysql/emoncms folder if the mysql dump is too large.

Make a backup copy of the feed data folders on your system, the default locations on linux are:

/var/lib/phpfiwa
/var/lib/phpfina
/var/lib/phptimeseries

Optional: Make a copy of the emoncms application folder usually found under /var/www/emoncms

2) Option A: Pull in latest version of emoncms core using git

If you installed emoncms using git, updating emoncms core is relatively straightforward. You may want to first note the exact version that you have installed. You can use this commit id to roll back if there is a problem with the update.

git rev-parse HEAD

To update just run git pull in the emoncms directory:

cd /var/www/emoncms
git pull

To roll back:

git checkout COMMIT_ID_COPIED_ABOVE   

2) Option B: Download the latest version of emoncms into a new folder

To test the new version without overwritting your current installation git clone emoncms into new folder with a different name to your existing emoncms installation:

cd /var/www
git clone https://github.com/emoncms/emoncms.git emoncms_new 

Create a new settings.php file from the new installations default.settings.php file.

Open settings.php in an editor:

$ nano settings.php

Enter in your database and any other relevant settings as required.

3) Update database

Log in with the administrator account (first account created)

Click on the Admin tab (top-right)

http://localhost/emoncms/admin/view

In the Update database section click the Update & check button to launch the database update script.

You should now see a list of changes to be performed on your existing emoncms database.

Click on apply changes to apply these changes.

If you can't login

If you can't login, use the authentication bypass to run the updater.

Add the following line to the bottom of settings.php to enable a special database update only session, be sure to remove this line from settings.php once complete:

$updatelogin = true;

In your internet browser open directly the admin/db page to launch the database update script.

http://localhost/emoncms/admin/db

You should now see a list of changes to be performed on your existing emoncms database.

Click on apply changes to apply these changes.

4) Confirm that you can access your data via the new emoncms installation

If you cannot see any of your data in the new installation:

  1. try clearing your browser cache

  2. if you have redis installed, try reseting redis with:

    $ redis-cli and then: flushall

  3. Make a note of any errors that you see, check if there are any errors in your browser's console window. Check that data is still coming in and viewable in your old emoncms installation. Post on the forums with information on the errors that you see and we can try to help.

5) If you followed option B above: rename your old emoncms folder to emoncms_old and rename emoncms_new to emoncms

This should complete the upgrade. If your data stops getting inserted try posting data manually and noting any errors that appear:

http://localhost/emoncms/input/post.json?csv=100,200,300

Post on the forums with information on the errors that you see and we can try to help.

In the mean time you may want to switch back to your old emoncms application folder.

Improve performance with Redis

From version 7 onwards, redis can be used to improve performance, using redis is optional but highly recommended. See emoncms installation guide for details

Clear browser cache

You may need to clear your browser cache if an interface appears buggy.