Migrate Domoticz to new RasPi

I have been running Domoticz for quite some time now and it has become the central point of our home. We don’t use it just for the lights but also camera’s, temperature, sunscreens, scenes etc. Though the recent version (4.10717) caused an error after updating on my old Pi generation 1 (GLIBC_2.17 missing) so it was time to migrate my installation to a new Pi (generation 3).

Normally an Domoticz upgrade is done in a few minutes though after I started it last week, the dashboard stayed down. When I logged into the Pi using SSH and started the Domoticz manual, the following error appeared;

pi@domoticz ~/domoticz $ ./domoticz
 ./domoticz: /lib/arm-linux-gnueabihf/libudev.so.1: no version information available 
 ./domoticz: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.17' not found 

So time for an Hardware upgrade!

Step 1; Save everything from the old Pi

Luckily I used the auto-backup feature to create a daily backup from the database. This means that Domoticz saves its database inside domoticz/backups Even though I was unable to boot domoticz, I could still reach it using SSH. I copied the whole /home/pi/domoticz folder to my desktop using WinSCP. You will have to check if you have sufficient rights to copy the complete content as some of the sub-folders where restricted. You can easily work around this by making the pi user owner of all the files and folders by running the following command

pi@domoticz:~ $ sudo chown -R ^C domoticz/*
pi@domoticz:~ $

Step 2; Create a new Pi installation

I had an Pi generation 3 laying around and decided to use that one for my new Domoticz installation. The first step was to create a clean and up-to-date installation. I grabbed the latest version of Raspbian Stretch Lite (the choice of OS from Domoticz itself) and placed the image on a Class 10 Micro SD card using Rufus.

After the SD Card was done, I tested it in the new Pi and it worked just fine. By default, the SSH server is disabled and I love to copy/paste commands using Putty from my own Desktop. So the first thing is to enable the SSH service and change the default password.

  1. The default username (pi) and password (raspberry) can be changed with the passwd command.
  2. Enter the “raspi-configuration” tool by executing the following command;
     sudo raspi-config
  3. Select “Interfacing Options” (fifth in the menu)
  4. Navigate to and select SSH
  5. Choose Yes
  6. Select Ok
  7. Choose Finish

Now we can SSH into the system using our favorite SSH client (putty in my case). I reran the raspi-config command to change the following in order to prepare for Domoticz; Hostname, Timezone and Expand the root file system (hidden under advanced option). After a reboot I updated everything with the following commands;

sudo apt-get update 
sudo apt-get upgrade  
sudo rpi-update 
sudo reboot

That’s it for the setup! Now we just need to install Domoticz on our new Pi and we can move on to the next step. There is a super easy way of installing with the following command;

curl -L https://install.domoticz.com | bash

I leave everything default except for the port (8080) which I change to 80.

Step 3; Migration

Now that we have a working Pi with a default Domoticz installation, I had to restore my settings and (history) data. I renamed the new installation folder and used WinSCP again to copy my backup “domoticz” folder to my new Pi. Below the steps for the rename thereafter I copied the data to the same location.

pi@domoticz:~ $ sudo service domoticz stop
pi@domoticz:~ $ mv domoticz domoticz_fresh

After the copy I tried to start it though discovered that the domoticz file was not executable though a quick

pi@domoticz:~ $ sudo chmod +x domoticz

fixed that issue I thought I was done at this point though after I started, nothing happened. I stopped the service and started it on the command line to check what was going on. I noticed that my OpenZWave Driver failed to load (see output below) I use a GPIO ZWave board from Zwave.me and I did not remembering getting a driver disk or anything 🙂

pi@domoticz:~/domoticz $ sudo ./domoticz
2019-05-14 17:23:29.963  Status: Domoticz V4.10717 (c)2012-2019 GizMoCuz
2019-05-14 17:23:29.963  Status: Build Hash: b38b49e5, Date: 2019-05-09 13:04:08
2019-05-14 17:23:29.964  Status: Startup Path: /home/pi/domoticz/
2019-05-14 17:23:29.993  Sunrise: 05:42:00 SunSet: 21:25:00
2019-05-14 17:23:29.993  Day length: 15:43:00 Sun at south: 13:34:00
2019-05-14 17:23:29.993  Civil twilight start: 04:59:00 Civil twilight end: 22:08:00
2019-05-14 17:23:29.993  Nautical twilight start: 03:60:00 Nautical twilight end: 23:08:00
2019-05-14 17:23:29.994  Status: PluginSystem: Failed dynamic library load, 
2019-05-14 17:23:30.004  Active notification Subsystems: (0/13)
2019-05-14 17:23:30.005  Status: WebServer(HTTP) started on address: :: with port 8080
2019-05-14 17:23:30.010  Status: WebServer(SSL) started on address: :: with port 443
2019-05-14 17:23:30.013  Status: Camera: settings (re)loaded
2019-05-14 17:23:30.061  Starting shared server on: :::6144
2019-05-14 17:23:30.062  Status: TCPServer: shared server started…
2019-05-14 17:23:30.062  Status: RxQueue: queue worker started…
2019-05-14 17:23:32.063  Status: Hardware Monitor: Started
2019-05-14 17:23:32.077  Status: P1 Smart Meter: Using serial port: /dev/ttyUSB0
2019-05-14 17:23:32.078  Error: P1 Smart Meter: Error opening serial port!
2019-05-14 17:23:32.079  Status: Nest: Worker started…
2019-05-14 17:23:32.080  Status: EventSystem: reset all events…
2019-05-14 17:23:32.082  Status: EventSystem: reset all device statuses…
2019-05-14 17:23:32.142  Status: EventSystem: Started
2019-05-14 17:23:32.142  Status: EventSystem: Queue thread started…
2019-05-14 17:23:32.580  Status: OpenZWave: using config in: /home/pi/domoticz/Config/
2019-05-14 17:23:32.584 Always, OpenZwave Version 1.4.3335 Starting Up
2019-05-14 17:23:32.585  Status: OpenZWave: Starting…
2019-05-14 17:23:32.585  Status: OpenZWave: Version: 1.4-3335-g74e05982-dirty
2019-05-14 17:23:32.587  Error: OpenZWave: Driver Failed!!

I search the web for just the driver though there was not a lot of information out there in regards to the GPIO version of my ZWave controller. Thus at the end I installed the zwave.me software;

pi@domoticz:~/domoticz $ wget -q -O - razberry.z-wave.me/install | sudo bash

After the installation that took about 2 minutes, I disabled the (web)service from zwave.me and did a reboot.

pi@domoticz:~/domoticz $ sudo update-rc.d z-way-server remove
pi@domoticz:~/domoticz $ sudo reboot

After the reboot domoticz ran just fine with all my historical data, settings, scenes etc. I did disabled the “Check for Updates (Not working on windows systems)” feature as I want to avoid this in the future (and my kids press on everything…)

Share this Article

Add a Comment

Your email address will not be published. Required fields are marked *