Import / Backup


« Previous step: Add Temperature Nodes


The Emoncms backup module can be used to backup Emoncms account data and import data from another Emoncms account. This process can also be used to migrate from an older emonPi / emonBase image to the latest image.

Currently the Backup Module can only be used with Local Emoncms not Emoncms.org

Backup / Export

Export from an older emonPi / emonBase

If the Backup module is not visible in the Local Emoncms menu then the emonPi / emonBase is running an older version e.g Emoncms V8.x.

To check what software stack (emonSD pre-built SD card) version an emonPi is running see instructions on emonPi emonSD download repository and changelog

To export data from an older emonPi:

  1. Install the backup module by running Admin > emonPi update in Local Emoncms
  2. Wait (up to) 60s for the update to begin and then another couple of minutes for it to complete; the update log page can be refreshed to view progress
  3. Log-out then back into Local Emoncms
  4. Backup module should now be visible under Extras > Backup
  5. Follow Backup instructions below

Backup

  1. Click Create Backup (see screenshot below)
  2. Wait for backup to be created, then refresh the page to view Download Backup link
  3. Download .tar.gz compressed backup

backup old data


Import / Restore

Importing / restoring a backup will overwrite ALL data in the current Emoncms account.

Note: If a new emonSD pre-built-SDcard image has been written to an SD card larger than 4GB the read-write ~/data partition should be expanded to fill the SD card to create sufficient space to import a backup. Do not use Raspbian raspi-config, instead connect via SSH) and run $ sudo emonSDexpand and follow prompts.

To import a backup:

  1. Check available disk space in the data partition (/home/pi/data), see Local Emoncms > Setup > Administration
  2. Select .tar.gz backup file
  3. Wait for upload to complete
  4. Click Import Backup
  5. Check restore log (see below)
  6. Log out then log back into Local Emocms using the imported account login credentials

Backup tar.gz filename cannot contain any spaces; e.g., if the same backup has been downloaded more than once: rename 'emoncms-backup-2016-04-23 (1).tar' to 'emoncms-backup-2016-04-23.tar' before uploading.

emonSDexpand will run ~/usefulscripts/sdpart/./sdpart_imagefile script, for more info see Useful Scripts Readme

Import

Successful import log example


Included in backup

  • Emoncms account credentials
  • Historic Feed data
  • Input Processing config (only when migrating from Emoncms V9 > V9 setup)
  • Dashboards
  • MyElectric / MySolarPV app settings
  • EmonHub config: emonhub.conf*

* Included in backup but not restored due to potential version conflicts: saved as old.xxxx.xxx in ~/data for manual restore if required.

Not included in backup

  • WiFi passcode & custom network config
  • Custom NodeRED flows
  • Custom openHAB settings
  • Input processing setup if migrating from Emoncms V8, input processing will need to be re-creatred after import and new inputs should be logged to imported feeds

How-to backup items not automatically included

  • nodeRED custom flows: select all flows then menu > export > clipboard copy the JSON text
  • Connect via SSH:
    • See Technical > Service Credentials
    • WiFi settings & password: backup copy: ~/data/wpa_supplicant.conf
    • openHAB custom config: copy ~/data/open_openHab folder

Video Guide


Troubleshooting

If you have any questions or if an error occures during the backup or import process please post in the Hardware > emonPi category of the Community Forums. Please provide as much infomation as possible e.g. backup / import logs and emonSD version.

Alternatively try and perform a manual import, see Backup Module Readme.


Next step: Applications: