Error when importing a backup

Trying to get this Ubuntu installation working.

I now have an error trying to import a backup.

module/backup_controller.php on line 89

Warning: move_uploaded_file(): Unable to move '/opt/emoncms/data/uploads/phpwfitny' to '/opt/openenergymonitor/data/uploads/emoncms-backup-2019-09-13.tar.gz' in /opt/emoncms/modules/backup/backup-module/backup_controller.php on line 89

I have searched through the code but I don’t understand it enough to work out what is wrong. I think it is the various paths or possibly file permissions.

The error in /var/log/emoncms/apache2-error.log is

[Sun Sep 15 09:35:59.485841 2019] [php7:warn] [pid 26228] [client 192.168.7.123:62123] PHP Warning:  move_uploaded_file(/opt/openenergymonitor/data/uploads/emoncms-backup-2019-09-13.tar.gz): failed to open stream: Permission denied in /opt/emoncms/modules/backup/backup-module/backup_controller.php on line 89, referer: http://192.168.7.77/backup
[Sun Sep 15 09:35:59.485916 2019] [php7:warn] [pid 26228] [client 192.168.7.123:62123] PHP Warning:  move_uploaded_file(): Unable to move '/opt/emoncms/data/uploads/phpLCkyqt' to '/opt/openenergymonitor/data/uploads/emoncms-backup-2019-09-13.tar.gz' in /opt/emoncms/modules/backup/backup-module/backup_controller.php on line 89, referer: http://192.168.7.77/backup

I have it working. I realised that I had manually created the uploads folder /opt/openenergymonitor/data/uploads but the owner was not www-data. Fixing that solved the problem.

@TrystanLea I’ve also worked out where the error stems from in the install scripts Folder is used in config but does not exist · Issue #32 · openenergymonitor/EmonScripts · GitHub

1 Like

Thanks @borpin

1 Like