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)

Hi Bob,
I seem to be getting similar problem I did the brewblox-ctl down, update, upgrade and reboot and I still get the same problem. It seems to time out.

pi@raspberrypi:~/brewblox $ brewblox-ctl setup
(...)
INFO       Starting configured services...
Creating network "brewblox_default" with the default driver
Creating brewblox_influx_1 ... 
Creating brewblox_history_1 ... 
Creating brewblox_traefik_1 ... 

ERROR: for brewblox_history_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for brewblox_influx_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for brewblox_traefik_1  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 influx  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for traefik  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 traefik influx history' returned non-zero exit status 1.
pi@raspberrypi:~/brewblox $ du -h
du: cannot read directory './influxdb/data/_internal': Permission denied
4.0K	./influxdb/data/_internal
8.0K	./influxdb/data
du: cannot read directory './influxdb/wal': Permission denied
4.0K	./influxdb/wal
8.0K	./influxdb/meta
24K	./influxdb
4.0K	./couchdb
16K	./traefik
16K	./brewblox_ctl_lib/data/config
20K	./brewblox_ctl_lib/data
28K	./brewblox_ctl_lib/__pycache__
52K	./brewblox_ctl_lib/commands/__pycache__
108K	./brewblox_ctl_lib/commands
180K	./brewblox_ctl_lib
240K	.
pi@raspberrypi:~/brewblox $ docker ps -a
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS                                      NAMES
461783b244ee        brewblox/brewblox-history:edge   "python3 -m brewbloxā€¦"   3 minutes ago       Created                                                        brewblox_history_1
69a2f8cb98a4        traefik:2.2                      "/entrypoint.sh --apā€¦"   3 minutes ago       Up 44 seconds       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   brewblox_traefik_1
5c5bebe98a24        influxdb:1.8                     "/entrypoint.sh inflā€¦"   3 minutes ago       Up 43 seconds       8086/tcp                                   brewblox_influx_1

Can you run other docker containers?

docker run --rm hello-world

pi@raspberrypi:~/brewblox $ docker run --rm hello-world
Unable to find image ā€˜hello-world:latestā€™ locally
latest: Pulling from library/hello-world
4ee5c797bcd7: Pull complete
Digest: sha256:7f0a9f93b4aa3022c3a4c147a449bf11e0941a1fd0bf4a8e6c9408b2600777c5
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

  1. The Docker client contacted the Docker daemon.
  2. The Docker daemon pulled the ā€œhello-worldā€ image from the Docker Hub.
    (arm32v7)
  3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
  4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

and there it stays. Is that it?

<pre><font color="#8AE234"><b>pi@raspberrypi</b></font>:<font color="#729FCF"><b>~/brewblox $</b></font> brewblox-ctl setup
<font color="#06989A">INFO       Stopping services...</font>
Stopping brewblox_influx_1  ... 
Stopping brewblox_history_1 ... 
Stopping brewblox_traefik_1 ... 

ERROR: for brewblox_history_1  UnixHTTPConnectionPool(host=&apos;localhost&apos;, port=None): Read timed out. (read timeout=70)

ERROR: for brewblox_traefik_1  UnixHTTPConnectionPool(host=&apos;localhost&apos;, port=None): Read timed out. (read timeout=70)

ERROR: for brewblox_influx_1  UnixHTTPConnectionPool(host=&apos;localhost&apos;, port=None): Read timed out. (read timeout=70)
<font color="#CC0000">ERROR</font>: 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 &apos;docker-compose down --remove-orphans&apos; returned non-zero exit status 1.</pre>

The hello-world output is normal.
Can you run sudo apt update && sudo apt upgrade -y, and then brewblox-ctl log?