Backup your brewblox

Hi

What is the best/recommended way to backup your Brewblox setup??

Do you need to backup both the raspberry and the spark??

brewblox-ctl backup save will backup everything except history data.

Hi
Will this just back it up to the SD card… I have had a few failing so trying to get a restore possibility??

Also, I the command just gives me an error…

login as: pi

pi@192.168.10.207’s password:
Linux Brew_bloxs 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Mar 2 19:58:21 2020 from 192.168.10.208
pi@Brew_bloxs:~ $ brewblox-ctl backup save
No such command “backup”.

Many commands only work if your current directory is a BrewBlox directory.
It looks like you installed BrewBlox in the default location.
To navigate there, run:

cd /home/pi/brewblox

pi@Brew_bloxs:~ $ cd /home/pi/brewblox
pi@Brew_bloxs:~/brewblox $ brewblox-ctl backup save
No such command “backup”.

Are you running the latest version? What is the output from brewblox-ctl help?

Hi
Brewblox-ctl help also failed… No such command “backup”

But my guess is that the installation is at least 1 year old…

From the interface i get:

Version

0.2.2+1176.g546b359d

Build date

Thu Oct 17 2019 12:24:34 GMT+0000 (Coordinated Universal Time)

If it helps…
I was hoping to do a backup before updating the system…

For a cruder, but still effective backup you can also copy and zip your brewblox dir.

I may have missed it, but it would be nice to have this backup function explained in Netlify, along with a newbie guide explaining how to transfer the .zip from the pi to a pc using ssh or perhaps sftp.

Sure. We avoided implementing an upload to cloud/other pc feature due to the lack of one-size-fits-all solutions, but I can add a guide describing some options.

What would be awesome is a similar backup function like the snapshot function found in homeassistant, if you are fammiliar with it…

I’m not very familiar with Home Assistent, but from their docs, their snapshots sound like our backups.

The functionality was added recently, and indeed isn’t present yet in your version.

One important concept in brewblox is that we keep all configuration contained in the install directory. That’s why you can make a backup of your system by copying your brewblox directory.

The guide @r_vandenbroek requested is currently in review. We’ll probably publish it tomorrow.

Guide is live at https://brewblox.netlify.com/user/backup_guide.html

Feel free to let us know if you feel something is missing or unclear.

1 Like

Fantastic and quick. Sure it will help people out there. One typo I spotted:

This will create a new zip archive in the backups/ directory inside your Brewblox directory. The file name includes the current date and time.

Should just be backup/ ofcourse.

Cheerio!

2 Likes

Hi
As the installation is old I tried to do an update without doing the backup…
No my smartest move i think… It seem like it has updated, but i have lost my configuration??

login as: pi
pi@192.168.10.134’s password:
Linux Brew_bloxs 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Mar 7 09:51:21 2020 from 192.168.10.208
pi@Brew_bloxs:~ $ sudo raspi-config
login as: pi
pi@192.168.10.134’s password:
Linux BrewBloxs 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Mar 7 09:56:14 2020 from 192.168.10.208
pi@BrewBloxs:~ $ brewblox-ctl update
Usage: brewblox-ctl [OPTIONS] COMMAND [ARGS]…
Try “brewblox-ctl --help” for help.

Error: No such command “update”.

Many commands only work if your current directory is a Brewblox directory.
It looks like you installed Brewblox in the default location.
To navigate there, run:

cd /home/pi/brewblox

pi@BrewBloxs:~ $ cd /home/pi/brewblox
pi@BrewBloxs:~/brewblox $ brewblox-ctl update
Do you want to remove old docker images to free disk space? [Y/n]: n
Command is about to: Download and apply updates.
Do you want to continue? (yes, no, verbose, dry-run) [press ENTER for default value ‘yes’]y
INFO Updating brewblox-ctl…
Requirement already up-to-date: brewblox-ctl in /usr/local/lib/python3.5/dist-packages
Requirement already up-to-date: requests in /usr/local/lib/python3.5/dist-packages (from brewblox-ctl)
Requirement already up-to-date: python-dotenv[cli] in /usr/local/lib/python3.5/dist-packages (from brewblox-ctl)
Requirement already up-to-date: pyyaml in /usr/local/lib/python3.5/dist-packages (from brewblox-ctl)
Requirement already up-to-date: click in /usr/local/lib/python3.5/dist-packages (from brewblox-ctl)
Requirement already up-to-date: pprint in /usr/local/lib/python3.5/dist-packages (from brewblox-ctl)
Requirement already up-to-date: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.5/dist-packages (from requests->brewblox-ctl)
Requirement already up-to-date: certifi>=2017.4.17 in /usr/local/lib/python3.5/dist-packages (from requests->brewblox-ctl)
Requirement already up-to-date: chardet<4,>=3.0.2 in /usr/local/lib/python3.5/dist-packages (from requests->brewblox-ctl)
Requirement already up-to-date: idna<3,>=2.5 in /usr/local/lib/python3.5/dist-packages (from requests->brewblox-ctl)
edge: Pulling from brewblox/brewblox-ctl-lib
Digest: sha256:fe04e0d3823298a0f7bcf54e5e7baa7a8ccc3fb45ff886a6538b900781143ec3
Status: Image is up to date for brewblox/brewblox-ctl-lib:edge
69b7d7c43d20f74328a70958951da802538c58c4bca890302d6191b967fc3d1b
ctl-lib
Command is about to: Download and apply updates.
Do you want to continue? (yes, no, verbose, dry-run) [press ENTER for default value ‘yes’]y
INFO Stopping services…
Stopping brewblox_mdns_1 … done
Stopping brewblox_traefik_1 … done
Stopping brewblox_influx_1 … done
Removing brewblox_eventbus_1 … done
Removing brewblox_emitter_1 … done
Removing brewblox_ui_1 … done
Removing brewblox_history_1 … done
Removing brewblox_datastore_1 … done
Removing brewblox_mdns_1 … done
Removing brewblox_traefik_1 … done
Removing brewblox_influx_1 … done
Removing network brewblox_default
INFO Migrating configuration files…
INFO Moving system services to docker-compose.shared.yml
INFO Writing env values for all variables
INFO Updating compose version to 3.7
INFO Pulling docker images…
Pulling emitter … done
Pulling eventbus … done
Pulling mdns … done
Pulling ui … done
Pulling history … done
Pulling traefik … done
Pulling influx … done
Pulling datastore … done
Pulling spark-one … done
INFO Starting services…
Creating network “brewblox_default” with the default driver
Creating brewblox_datastore_1 …
Creating brewblox_influx_1 …
Creating brewblox_traefik_1 …
Creating brewblox_emitter_1 …
Creating brewblox_ui_1 …
Creating brewblox_eventbus_1 …
Creating brewblox_mdns_1 …
Creating brewblox_history_1 …

ERROR: for brewblox_emitter_1 UnixHTTPConnectionPool(host=‘localhost’, port=None): Read timed out. (read timeout=60)

ERROR: for brewblox_mdns_1 UnixHTTPConnectionPool(host=‘localhost’, port=None): Read timed out. (read timeout=60)

ERROR: for brewblox_history_1 UnixHTTPConnectionPool(host=‘localhost’, port=NonCreating brewblox_influx_1 … done
Creating brewblox_traefik_1 … done
ERROR: for brewblox_eventbus_1 UnixHTTPConnectionPool(host=‘localhost’, port=NoCreating brewblox_ui_1 … done

ERROR: for brewblox_datastore_1 UnixHTTPConnectionPool(host=‘localhost’, port=None): Read timed out. (read timeout=60)

ERROR: for mdns UnixHTTPConnectionPool(host=‘localhost’, port=None): Read timed out. (read timeout=60)

ERROR: for eventbus UnixHTTPConnectionPool(host=‘localhost’, port=None): Read timed out. (read timeout=60)

ERROR: for history UnixHTTPConnectionPool(host=‘localhost’, port=None): Read timed out. (read timeout=60)

ERROR: for datastore UnixHTTPConnectionPool(host=‘localhost’, port=None): Read timed out. (read timeout=60)

ERROR: for emitter UnixHTTPConnectionPool(host=‘localhost’, port=None): Read timed out. (read timeout=60)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
Command ‘docker-compose up -d --remove-orphans’ returned non-zero exit status 1
Command ‘/usr/bin/python3 /usr/local/bin/brewblox-ctl update --update-ctl-done --no-prune’ returned non-zero exit status 1
pi@BrewBloxs:~/brewblox $

Your configuration is still there.

These docker timeouts can have multiple causes, but you can likely fix it by running

brewblox-ctl down
sudo apt update
sudo apt upgrade -y
sudo reboot

When the pi is done rebooting, try running the update again.

I got it up and running again, took 4-5 attempts and it seemed to be a bit random what failed(timeout)…
Thank you for the assistance

Docker pull timeout errors are always a bit tricky, as they are a symptom of something seemingly unrelated.

How much free space does your SD card have? (du -h)
How old / used is your SD card?
Are there leftover containers running? (docker ps -a)