-
-
Notifications
You must be signed in to change notification settings - Fork 510
Backup and Restore
Kyle Gabriel edited this page Dec 20, 2017
·
12 revisions
Mycodo can be backed up and restored from the web UI, under the Configure -> Backup/Restore page. However, if you cannot access this page or prefer to do it from the command line, you may do so with the following commands.
sudo /bin/bash ~/Mycodo/mycodo/scripts/upgrade_commands.sh backup-create
sudo /bin/bash ~/Mycodo/mycodo/scripts/upgrade_commands.sh backup-restore <restore_backup>
Replace <restore_backup>
with the backup you would like restored. It must be the full location. Use the following command to see what backups exist.
ls -l /var/Mycodo-backups
Example output
pi@raspberry:~$ ls -l /var/Mycodo-backups
drwxrwxr-x 9 mycodo mycodo 4096 Jun 19 23:33 Mycodo-backup-2017-06-23_02-07-50-5.0.35
drwxrwxr-x 9 mycodo mycodo 4096 Jun 19 23:33 Mycodo-backup-2017-07-06_19-04-27-5.0.41
The full restore command to select the earlier version from this example would be
sudo /bin/bash ~/Mycodo/mycodo/scripts/upgrade_commands.sh backup-restore /var/Mycodo-backups/Mycodo-backup-2017-07-06_19-04-27-5.0.41
An influxdb backup will save all the sensor, relay, and PID data.
influxd backup <path-to-metastore-backup>
influxd backup -database mycodo_db <path-to-database-backup>
service influxdb stop
influxd restore -metadir /var/lib/influxdb/meta <path-to-metastore-backup>
influxd restore -database mycodo_db -datadir /var/lib/influxdb/data <path-to-database-backup>
sudo chown -R influxdb:influxdb /var/lib/influxdb
service influxdb start