Hello, i am trying to update mycodo with a backup i saved in my computer.
When i go to the section of backup/restore only appears the ones i did in these raspberry. But i want to update the other old backup.
I tried to copy this via ssh with the command:
scp [source files] [user]@[host]:[path]
C:\Users\ser6io>scp C:\Users\ser6io\Mycodo_Backup_2022-05-09_22-32-56-8.13.9_raspberrypi_.zip email@example.com:Mycodo firstname.lastname@example.org’s password:
Mycodo_Backup_2022-05-09_22-32-56-8.13.9_raspberrypi_.zip 100% 32MB 1.2MB/s 00:26
It looks succesfull.
Then i tried to do the commands at ssh:
sudo /bin/bash ~/Mycodo/mycodo/scripts/upgrade_commands.sh backup-restore <restore_backup>
pi@raspberrypi:~ $ sudo /bin/bash ~/Mycodo/mycodo/scripts/upgrade_commands.sh backup-restore Mycodo/Mycodo_Backup_2022-05-09_22-32-56-8.13.9_raspberrypi_.zip
Directory does not exist
Could anyone help me with the directory?
what suppoust to be the directory of the file i uploaded before?
WARNING: MAKE A MYCODO BACKUP BEFORE ATTEMPTING A SETTINGS IMPORT!
This will allow a ZIP file containing the Mycodo settings database and custom functions/inputs/outputs/widgets to be uploaded and replace the current settings. Only databases from Mycodo versions equal or prior to the current Mycodo version should be imported. There is no check for this, but if you attempt to import a database from a version higher than the current Mycodo version, there will likely be issues. There may also be issues if the custom controllers are incompatible with the Mycodo version you’re importing in to.
Note 1: This will override all settings, user accounts, and custom functions/inputs/outputs/widgets, and log you out from the web UI. A backup of the current database will be created in the database directory (~/Mycodo/databases/mycodo.db.backup_DATE_TIME).
Note 2: During this process, the new database will be upgraded to the current Mycodo version and all unmet dependencies will be installed. This process can take a while to complete if there are a significant number of dependencies to install, so be patient.
and the program shows:
Error: Import Settings: Invalid file name: Mycodo_Backup_2022-05-09_22-32-56-8.13.9_raspberrypi_.zip: 2022-05-09 != Settings
Error: Import Settings: Correct format is: Mycodo_MYCODOVERSION_Settings_DBVERSION_HOST_DATETIME.zip
Error: An error occurred during the settings database import.
It’s certainly possible, as a backup is the entire Mycodo directory that has been compressed to an archive file. A settings export file is merely an archive of the most minimal components necessary to restore a system. I have never taken a backup archive and attempted a restore, so I cannot give you an exact set of commands that I know will work, but essentially you should be able to follow these steps:
Transfer the backup archive to your remote system
Extract the archive to ~/Mycodo making sure that directory doesn’t already exist
If Mycodo has been previously installed on the system, run ~/Mycodo/mycodo/scripts/upgrade_post.sh
If Mycodo has not been previously installed on the system, run ~/Mycodo/install/setup.sh
That was not clear for me too!
I am trying to create a backup, so anyone can recovery this as a template to install the same things as me!
I could not understand how the backup system works to recovery everything from an empty mycodo installation. Could you made it more clear, starting from how to generate a backup on the mycodo page (/backup)
I can certainly add better errors that will indicate when you’ve uploaded the wrong file, but more importantly, I can add the ability to import backup archives, which will then allow you to use the Restore Backup functionality on the Backups page for the backup archive you just imported.