I would like to try using the dropbox automated back-ups (and restores?) it looks like a great tool and I appreciate all the work @Paul has put into it, but there is a significant reason it probably won’t work for me and therefore perhaps others too. I would therefore like to suggest a change in the way I believe it works to be more widely adoptable. I am not asking for this work to be done for me, I am happy to contribute if there is interest.
I know this is primarily written for the home user with one account as is much of the OEM project, but I run many accounts/users on my self-hosted emoncms, looking at the current settings file for the dropbox-archive, it asks for a write apikey (I’m sure you can see where this is heading now), which write apikey would I choose?
I then assume only that users account would get backed up, correct?
Does that mean I need to run this for each user?
Is it even possible to have multiple instances of the script or at least point it at multiple settings files?
If so would that mean I then have global server settings saved with each and every users data?
If I then restore one backup would it leave me with just one user?
Can I do selective or multiple restores to rebuild parts or the whole system?
Since the ability to have one dropbox-archive that can back-up all users would be a great tool for multi account installs I wonder if the code could be changed to suit one or more accounts?
My initial idea is, since the utility is given the mySQL user and password, could the script query the emoncms database’s user table to get a list of write apikey’s (a list of one in single user applications) and cycle through those apikeys ?
If we can get that bit working then at least a full restore of all users is then easily implemented.
Perhaps then we could look at selective restores. So for example if I or one of my clients make a hash of a single account I could restore just that account. I have not looked at the restore scripts yet but again I would be happy to get involved, so that perhaps the current “restore” command works ‘as is’ for the single account user and does a full restore of all accounts for a multi account user, but something like a “restore user99” command would do just that without touching the “globals” like settings.conf, emonhub.conf and node-red etc.