Glyn and I have been working on a new emoncms backup/restore module. Modularising the backup feature recently added to the emoncms admin module and adding the ability to upload and import a backup file from a web browser.
The picture below shows what it looks like. When the create backup or import button is clicked, it triggers a backup script or import script to run in the background via a service-runner script. The output of the script is recorded to a log file which is shown in the log viewers so that it's possible to check on progress.
This is currently built for the emonpi and has paths hard coded for the emonpi. In time, we would like to make it generic for different installation environments.
For anyone interested in testing, the installation documentation can be found in the repository here: https://github.com/emoncms/backup and involves installing the module in the home folder and symlinking a subfolder into emoncms. The module contains quite a few files that would be best not placed in a public html folder, in particular the mysql authentication extractor: https://github.com/emoncms/backup/blob/master/get_emoncms_mysql_auth.php. Symlinking the required files into emoncms seemed like a good approach in this instance although I'm not sure whether it's the best long-term solution given it's not the standard approach used with other modules.
A small change is needed to emoncms to make it possible for emoncms to detect the menu file, see: https://github.com/emoncms/emoncms/compare/symlinked_modules
https://github.com/emoncms/backup
Re: New emoncms backup module
This looks really great.
Will try this on my ubuntu install when i got the time.
Is phpfiWa data nog backupped?
Re: New emoncms backup module
Is phpfiWa data nog backupped?
No because phpfiwa feeds are not compatible with emoncms in low-write mode, therefore there's none to be backed up.
Hopefully, further work may be done to ensure that we can use it in emonbase's as well as emonpi's.
Paul
Re: New emoncms backup module
This is a great addition to the system, thanks for all the hard work!
One suggestion for the future, would it be possible to add in a daily backup to a USB memory stick maybe with a 14 day rotation to ensure it doesn't get full. It could be useful for that deep and distant day when the SD Card finally decides its had enough, and the system has been fully setup and left alone for a while.
Thinking a little further maybe it could check every so often to see if a USB stick is plugged in, and if it is start the timed backup, possibly with a disable button in the backup screen.
Re: New emoncms backup module
Hi Trystan
Not sure if this is a bit out of scope for the module, but would it be possible to include node-red in with the backup
Thanks Steve
Re: New emoncms backup module
+1 - I'd like to see this also!
Re: New emoncms backup module
Could I suggest a config option to automate a backup strategy. For instance if daily was an option, a file would be created with the day instead of the date in the file name and so these would overwrite. You could also have a weekly (week of the year as the name, day of week in config) or monthly (month number, day of month in config) option that could run consecutively (by copying the file as appropriate). This would help if you were backing up to cloud storage and had limited space.