Export local data to move the gateway to another machine

Is it possible to export all data (rules, things…) so I can move the installation to another machine to provide more flexibility? Would the attached Conbee adapter cause problems in that case (I would of course move it to the new machine as well)?

You could do the following to move all of your data:

# From new machine
scp -r pi@gateway.local:~/.mozilla-iot ~/
2 Likes

Thanks, and then I just have to install the gateway on the new machine and start it and it should work like nothing happened right? (except of course the different host)

Yes, exactly! I do that quite frequently when reflashing my RPi.

Great, I liked the raspi setup (really quick), but I am a little concerned about the long term durability of a 24/7 attached SD card, so I am planning to move everything on a machine which also has BT and wifi (I am using a raspi 2), although I won’t be using the latter.
Do you have experience with zigbee hardware? Will I have to repair everything, and will it void my rules?

All of your Zigbee devices should still work just fine, as long as you’re using the same dongle.

ok that’s the plan, I have no use for more than one dongle at the time being.
Thanks

Is this a safe way to back up everything into a .zip file?

sudo systemctl stop mozilla-iot-gateway.service
zip -r mozilla-iot.zip ~/.mozilla-iot/
sudo systemctl start mozilla-iot-gateway.service

(Stop the gateway first so that the sqlite database will be stable. Then make mozilla-iot.zip that contains the contents of .mozilla-iot. Then restart the gateway.)

Might need to do

sudo apt update
sudo apt install zip

if zip isn’t installed.

2nd question. Should we all be doing

sudo apt update
sudo apt upgrade

to keep Raspian updated? I didn’t know if doing this would break anything in the gateway.

Yes, that would be a good way to back things up.

As for updating… In theory, that’s a good idea. In practice, though, that can break lots of things. I’ve broken several gateways by doing that and have had to reflash.

Thank you. You just covered my next question. :slight_smile:

Why not boot from a network drive? This pretty much eliminates all the problems associated with SDCards, or so I have read, without much sacrifice in speed. I have been wanting to do this myself actually.

Booting from network would be a good idea, but I have a raspi 2 version ‘Pi 2 Model B v1.1’, and network model is supported only on 1.2 :frowning: