Page 1 of 1
keeping Raspberry PI up-to-date
Posted: Monday 16 October 2017 17:35
by ricorico94
Hi,
I sinstalled Domoticz on a Raspberry Pi 2 by late 2015, using the standard image provided by the Domoticz team.
So far, everything is all right..
But I now want to install also a Mysensors gateway, and I wanted to install that gateway on the PI hosting Domoticz, which should run smoothly based on Mysensors team feedback.
But I face issues on installing that gateway, and part of my worries (or at least part of them), seem to come from my old version of linux: apparently, the standard image I used is Wheezy, whereas instructions for that gateway are for Jessie (instrtuctions, but also version of GCC creates errors when making the files).
So, I've one basic question : is it worth upgrading my PI to get the latest Jessie versions, or should I rather stay with Wheezy and see if I can find workarounds without Jessie ? (I also saw that Jessie is now the preferred Domoticz environment as per Wiki..)
Is an upgrade 'safe' ? or too risky, and I should go from another clean install.. but meaning I'd have to reinstall all scripts, CRON, whatever else I had to customize.
If you think upgrading is worthwhile and safe, do you know a good tutorial ? I found that one :
http://www.journaldulapin.com/2016/03/0 ... pberry-pi/
Is there a better one ?
br,
Ricorico94
Re: keeping Raspberry PI up-to-date
Posted: Monday 16 October 2017 17:49
by Egregius
Even Jessie is already old... Now it's Stretch.
Either you update from Wheezy to Jessie and then to Stretch using apt-get update && apt-get upgrade && apt-get dist-upgrade
Or you do a clean install of Jessie and restore your Domoticz backup.
Re: keeping Raspberry PI up-to-date
Posted: Monday 16 October 2017 19:46
by jannl
I hope your pi is not connected to the internet. Not updating can be risky, got me a phishingpage hosted on a linux system once.
Anyway, in your case I would by a second sd card and install the new system on that card. So you can put the working card back at the end of an evening or so. Also keeps you wife (or so) happy.
Re: keeping Raspberry PI up-to-date
Posted: Tuesday 17 October 2017 20:10
by sincze
Egregius wrote:Even Jessie is already old... Now it's Stretch.
Either you update from Wheezy to Jessie and then to Stretch using apt-get update && apt-get upgrade && apt-get dist-upgrade
Or you do a clean install of Jessie and restore your Domoticz backup.
Pieuw.. Fingers crossed.. Jessie to Stretch it will have to be.....
Sent from my SM-G925F using Tapatalk
Re: keeping Raspberry PI up-to-date
Posted: Wednesday 18 October 2017 0:27
by ricorico94
Hi,
Your advice make sense.. Clean install is always better..
However, I couldn't find a tutorial detailing all steps to really migrate domoticz to new installation: in my understanding, copying the domoticz is not enough, as there are other files and customizations : wifi config, files to make USB persistent assignment, CRON tabs, openzwave (unless domoticz is now installing it by default?), installing python, pigz, some scripts (potentially stored under domoticz folder), etc..
Is there an easy way to migrate all these cstimisations to new SD image ?
br,
Ricorico94
Re: keeping Raspberry PI up-to-date
Posted: Wednesday 18 October 2017 7:29
by jannl
What I did starting the first installation, I wrote down all steps needed. When I do a new install I simply use that and adapt it a bit because jessie took some different thins as well did stretch. Openzwave has been compiled in in domoticz since a long time. (At least over 2 years).
With crontab -l > crontab.txt you can make a backup of your crontab. Backup your scripts directory. All other files I update (for instance rsyslog.conf, zwfg file) I copy to a subdir of the scripts dir so it gets backupped automatically daily. Finally I backup the file I personally added or updated in the www dirs. Not the complete dir because you get problems when updating domoticz.
And use google a lot.
Re: keeping Raspberry PI up-to-date
Posted: Wednesday 18 October 2017 8:28
by Nautilus
ricorico94 wrote: ↑Wednesday 18 October 2017 0:27
Hi,
Your advice make sense.. Clean install is always better..
However, I couldn't find a tutorial detailing all steps to really migrate domoticz to new installation: in my understanding, copying the domoticz is not enough, as there are other files and customizations : wifi config, files to make USB persistent assignment, CRON tabs, openzwave (unless domoticz is now installing it by default?), installing python, pigz, some scripts (potentially stored under domoticz folder), etc..
Is there an easy way to migrate all these cstimisations to new SD image ?
br,
Ricorico94
I have the same challenge ahead of me as I'm still running Domoticz on RPi2 / Wheezy and will migrate to RPi3 / Stretch. After the normal RPi / Raspbian procedures I will (at least):
- Install monit and copy the config file (/etc/monit/monitrc)
- Install git
- Install jq
- Install homebridge and eDomotic-homebridge (and copy the config file, maybe also persistent data)
- Install HarmonyHubCLI
- Install mosquitto
- Install node
- Install python-oauth
- Install python-setuptools
- Install nginx
- Copy crontab
- Copy persistent USB devices config (/etc/udev/rules.d/99-usb-serial.rules)
- Install Domoticz
- Install dtgbot
- Restore latest domoticz.db backup
- Restore latest ../domoticz/xxx backup (/scripts, /www/templates etc)
- Copy certain files from /etc/init.d, at least domoticz.sh and dtgbot, maybe homebridge (but ok, not sure if all these can be used with Stretch anymore?)
- Change IP to same as the original RPi2 (after everything is ready with the new installation)
Maybe something else as well...

Re: keeping Raspberry PI up-to-date
Posted: Wednesday 18 October 2017 9:24
by jake
When I did such a job a couple months back, i had an issue with my fritzbox: putting a new device on the network, with the same ip address as the disconnected old one. It did not work well. I had to delete in the fritzbox the current port forward for the original pi to really release the old mac address/ip combination of the old pi. Really weird.
Verstuurd vanaf mijn SM-G930F met Tapatalk
Re: keeping Raspberry PI up-to-date
Posted: Wednesday 18 October 2017 10:13
by jannl
I also have a fritzbox with also a port forward, but no issues when changing pi's. Already did it twice. The pi has no dhcp.
Re: keeping Raspberry PI up-to-date
Posted: Thursday 19 October 2017 12:50
by ricorico94
Hi,
@jannl:
I copy to a subdir of the scripts dir so it gets backupped automatically daily
Could detail me how you do that ? do you add a script in a CRON table ?
@Nautilus : would you by chance have the list of commands you use for doing all these steps ? My knowledge is still limited in Linux and despite I try to understand the logic and the commands, there most often plenty of switches and I'm always afraid of making a mistake.
Thanks a lot !
Ricorico94
Re: keeping Raspberry PI up-to-date
Posted: Thursday 19 October 2017 14:58
by jannl
It is in the wiki:
https://www.domoticz.com/wiki/Daily_bac ... ternal_hdd.
There are several examples, use pieces from all of them.
Do not stop/start Domoticz when using the json backup call.
Re: keeping Raspberry PI up-to-date
Posted: Monday 23 October 2017 22:55
by Nautilus
ricorico94 wrote: ↑Thursday 19 October 2017 12:50
@Nautilus : would you by chance have the list of commands you use for doing all these steps ? My knowledge is still limited in Linux and despite I try to understand the logic and the commands, there most often plenty of switches and I'm always afraid of making a mistake.
Sorry I'm afraid the answer is no. I'll probably document it step by step once I get around it but until then it is only that list. And please note that for a "standard" Domoticz installation majority of the steps is not required. I think it is mostly that you install Domoticz, then copy over you backup of /home/pi/domoticz....