Backup : Error: missing backup config.cfg

Hi,

I have a custom install of emoncms on a Raspberry Pi 4.
It seems I recently had an SD card corruption problem… could solve it by reinstalling packages and files (the Pi could still boot).

Now, I would like to make a fresh install on a new SD card, but I want to save data first.
What is the best way ?

  1. Is the backup tool a good solution ?

Supposed yes, but from the tool bar, in menu, I get :
Error: missing backup config.cfg
This error message was already here before SD card problems.

  1. How can I solve this ?

  2. Is there a better way to save data (to get them restored on a fresh install) ?

Here is my environment :

Thanks !

Hello @fonze do you wish to use a custom installation for your next install? or will you be using the EmonScripts installation scripts or downloading the emonSD image?

One option is to use the process described here to import the data from one SD card to another Import / Backup - Guide | OpenEnergyMonitor.

Or alternatively you could probably fix that error by creating the backup.cfg from default.config.cfg backup/default.config.cfg at master · emoncms/backup · GitHub.

The standard configuration on an emonSD image is:

# Emoncms Export and Import scripts config file

## DEFAULT CONFIG ##

# These settings are used for both the export and import scripts.
# To export from one location and import into another
# Used by both PHP and Bash and comments are not ignored

# Change all capitalised placeholders to relevant locations

# user
user="pi"

backup_script_location="/opt/emoncms/modules/backup"

# Directory location of Emoncms
emoncms_location="/var/www/emoncms"

# Destination location of exported backup .tar.gz - Must be writable
backup_location="/var/opt/emoncms/backup"

# location of phpfina phpfiwa and phptimeseries databases
database_path="/var/opt/emoncms"

# Location of emonhub.conf - leave blank if backup not required
emonhub_config_path="/etc/emonhub"

# Location of specimen emonhub config
emonhub_specimen_config="/opt/openenergymonitor/emonhub/conf"

# Location of compressed backup data to import .tar.gz
backup_source_path="/var/opt/emoncms/backup/uploads"

Hello @TrystanLea,

Thanks for the help !

The only reason I did a custom install is I wanted emoncms hosted as a subsite (i.e. mysite.com/emoncms), and also host some other simple websites (for example a small Wordpress website - php and mysql) on the same Pi.

Of course, installation scripts or downloading the emonSD image would be easier to get emoncms working for me.
But would the http server part be easily configurable to get multiples simple websites on the same install ? Or is this a bad idea ?

By default EmonCMS is installed to /var/www/emoncms so it will just be a case of you adjusting your Apache2 Virtual Host configuration to suit your local needs. You may also need to adjust the .htaccess in the emoncms root folder.

Don’t ask me how, I just know it is possible to do :slight_smile: