layout | title | description | date | sidebar | comments | sharing | footer | published |
---|---|---|---|---|---|---|---|---|
page |
Import / Backup |
Import data from existing emonPi Emoncms accounts |
2015-03-08 21:36 |
true |
false |
true |
true |
true |
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
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 repository and changelog
To export data from an older emonPi:
- Install the backup module by running
Admin > emonPi update
in Local Emoncms - 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
- Log-out then back into Local Emoncms
- Backup module should now be visible under
Extras > Backup
- Follow Backup instructions below
- Click
Create Backup
(see screenshot below) - Wait for backup to be created, then refresh the page to view
Download Backup
link - Download
.tar.gz
compressed backup
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:
- Check available disk space in the data partition (
/home/pi/data
), seeLocal Emoncms > Setup > Administration
- Select
.tar.gz
backup file - Wait for upload to complete
- Click
Import Backup
- Check restore log (see below)
- 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
View
Sat 23 Apr 00:42:28 UTC 2016 Reading ~/backup/config.cfg.... Location of mysql database: /home/pi/data Location of emonhub.conf: /home/pi/data Location of emoncms.conf: /home/pi/data Location of Emoncms: /var/www/emoncms Backup destination: /home/pi/data Backup source path: /home/pi/data/uploads Starting import from /home/pi/data/uploads to /home/pi/data... Image version: emonSD-29Mar16 new image Backup found: emoncms-backup-2016-04-23.tar.gz starting import.. Decompressing backup.. Removing compressed backup to save disk space.. Wipe any current data from account.. Restore phpfina and phptimeseries data folders... Emoncms MYSQL database import... Import emonhub.conf > /home/pi/data/old.emohub.conf Import emoncms.conf > /home/pi/data/old.emoncms.conf Start with fresh config: copy NEW default emonpi.emonhub.conf: cp /home/pi/emonhub/conf/emonpi.default.emonhub.conf /home/pi/data/emonhub.conf OK Update Emoncms Database ["ALTER TABLE dashboard MODIFY `height` int(11) Default '600'","ALTER TABLE dashboard MODIFY `main` tinyint(1) Default '0'","ALTER TABLE dashboard MODIFY `public` tinyint(1) Default '0'","ALTER TABLE dashboard MODIFY `published` tinyint(1) Default '0'","ALTER TABLE dashboard MODIFY `showdescription` tinyint(1) Default '0'","ALTER TABLE `dashboard` ADD `backgroundcolor` varchar(6) NOT NULL DEFAULT 'EDF7FC'","ALTER TABLE feeds MODIFY `time` int(10);","ALTER TABLE feeds MODIFY `value` double;","ALTER TABLE `feeds` ADD `processList` text NOT NULL","ALTER TABLE input MODIFY `time` int(10);","ALTER TABLE users MODIFY `salt` varchar(32);","ALTER TABLE users MODIFY `timezone` varchar(64) Default 'UTC';"] Restarting emonhub... Restarting feedwriter... Sat 23 Apr 00:42:39 UTC 2016 === Emoncms import complete! ===
- Emoncms credentials (username, password)
- Feed data
- Input Processing config
- Dashboards
- MyElectric / MySolarPV app settings
- EmonHub config:
emonhub.conf
* - Emoncms config:
settings.php
*
* Included in backup but not restored due to potential version conflicts: saved as old.xxxx.xxx
in ~/data
for manual restore if required.
- WiFi settings & passcode
- Custom NodeRED flows
- Custom openHAB settings
- 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
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.
-
Integrations e.g openHAB, nodeRED etc