update domoticz from 3.7 (2017 version)

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
jackwan1
Posts: 41
Joined: Saturday 15 April 2017 20:04
Target OS: Linux
Domoticz version: 2020.2
Location: USA
Contact:

update domoticz from 3.7 (2017 version)

Post by jackwan1 »

Help

OS: Ubuntu server 18.04lts

It is my bad that I slacked and did not update domoticz for a long time. I am still using the 3.7 from 2017!

Now it seems the auto update program is not working, perhaps mine is too old.

I tried curl and ./updaterelease to no avail. What can I do?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by waaren »

jackwan1 wrote: Sunday 10 May 2020 18:17 Now it seems the auto update program is not working, perhaps mine is too old.
Below you see the content of the current updaterelease script. Can you replace your updaterelease script with this and try again?
Before you do this please make sure you have a recent and complete backup to make sure you can go back to a working system when things are not working as expected.

Code: Select all

#!/bin/sh

# This script can be used to upgrade to the latest release version

lowercase(){
    echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
}

OS=`lowercase \`uname -s\``
MACH=`uname -m`
if [ ${MACH} = "armv6l" ]
then
 MACH="armv7l"
fi

echo "Updating to latest release version..."
echo "Please Standby..."
wget -4 -O domoticz_release.tgz --no-check-certificate "https://www.domoticz.com/download.php?channel=stable&type=release&system=${OS}&machine=${MACH}"
tar xvfz domoticz_release.tgz
rm domoticz_release.tgz
echo "Restarting Domoticz... (please standby...)"
sudo service domoticz.sh restart
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
sancla
Posts: 105
Joined: Wednesday 01 January 2020 23:01
Target OS: -
Domoticz version:
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by sancla »

First, make a proper backup of your files. It does not hurt and makes you have a roll back scenario in all fails.
You can even make a complete image backup of you current raspberry pi instance.
Just to be sure, write down your current distro and Domoticz version.

To make a backup, check this article:
https://sancla.com/domoticz/how-to-back ... duplicati/

Second, what you could try is to update your installation by installing the latest version. I believe that the database will be upgraded as well. But to be sure, check the Domoticz wiki pages.

Also, take care of your plugins. Chances are you need to recreate the devices. It is possible to maintain the sensor history but chances are you need to dive into the database.

Lastly, upgrading from such an old version can potentially be a bumpy road, take your time.
Assuming that the underlying pi hardware is just as old as your distro, how about buying a new raspberry pi and see if you can get it working on that one with the latest firmware. Once you figured out your upgrade path, you can easily switch over. Without breaking your current Domoticz installation.
Check these howto's: https://sancla.com
jake
Posts: 742
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by jake »

Don't forget that you need Debian Buster to run the latest stable version of domoticz!
jackwan1
Posts: 41
Joined: Saturday 15 April 2017 20:04
Target OS: Linux
Domoticz version: 2020.2
Location: USA
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by jackwan1 »

@waaren

Thanks. I took your code and created another process (updaterelease1)
But I got the same 404 not found from executing it. I don't think your code is any different from updaterelease I have in the current directory.

see the screen output..
domoticz1.jpg
domoticz1.jpg (233.83 KiB) Viewed 1619 times
waaren wrote: Sunday 10 May 2020 18:21
jackwan1 wrote: Sunday 10 May 2020 18:17 Now it seems the auto update program is not working, perhaps mine is too old.
Below you see the content of the current updaterelease script. Can you replace your updaterelease script with this and try again?
Before you do this please make sure you have a recent and complete backup to make sure you can go back to a working system when things are not working as expected.

Code: Select all

#!/bin/sh

# This script can be used to upgrade to the latest release version

lowercase(){
    echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
}

OS=`lowercase \`uname -s\``
MACH=`uname -m`
if [ ${MACH} = "armv6l" ]
then
 MACH="armv7l"
fi

echo "Updating to latest release version..."
echo "Please Standby..."
wget -4 -O domoticz_release.tgz --no-check-certificate "https://www.domoticz.com/download.php?channel=stable&type=release&system=${OS}&machine=${MACH}"
tar xvfz domoticz_release.tgz
rm domoticz_release.tgz
echo "Restarting Domoticz... (please standby...)"
sudo service domoticz.sh restart
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by waaren »

jackwan1 wrote: Sunday 10 May 2020 20:15 Thanks. I took your code and created another process (updaterelease1)
But I got the same 404 not found from executing it. I don't think your code is any different from updaterelease I have in the current directory.
There is no longer an prebuild binary for i686 systems. I f you want to have a recent domoticz on that platform you need to build domoticz yourself from source. An howto can be found on this wiki page
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
jackwan1
Posts: 41
Joined: Saturday 15 April 2017 20:04
Target OS: Linux
Domoticz version: 2020.2
Location: USA
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by jackwan1 »

Thanks @warren

I followed the instruction in the wiki page to the letter and was able to "make" or build from source code, Except

in the last section, the instruction "cd domoticz" does not work, because there was nothing in that subdirectory, the current directory is /dev-domoticz

I was able to run sudo ./domoticz from the dev-domoticz and for 12 minutes, I was stuck in the plug-ins process, I cancel the entire process
and issue the command sudo service domoticz start. You can see in my attached screen shot

The problem now is when I web access my server (192.168.1.5:18088) I got "domoticz offline".

Should I go back to redo that sudo ./domoticz and wait it finish. I also saw that error message "no server is installed" perhaps that is the reason it is off line, what did I do wrong. In the domoticz.sh file I did change the www port to 18088 and input my id, that is all. How come ./domoticz did not find the ip address and port?
domoticz2.jpg
domoticz2.jpg (285.7 KiB) Viewed 1563 times
waaren wrote: Sunday 10 May 2020 22:26
jackwan1 wrote: Sunday 10 May 2020 20:15 Thanks. I took your code and created another process (updaterelease1)
But I got the same 404 not found from executing it. I don't think your code is any different from updaterelease I have in the current directory.
There is no longer an prebuild binary for i686 systems. I f you want to have a recent domoticz on that platform you need to build domoticz yourself from source. An howto can be found on this wiki page
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by waaren »

jackwan1 wrote: Monday 11 May 2020 22:09 Except in the last section, the instruction "cd domoticz" does not work, because there was nothing in that subdirectory, the current directory is /dev-domoticz

I was able to run sudo ./domoticz from the dev-domoticz and for 12 minutes, I was stuck in the plug-ins process, I cancel the entire process
and issue the command sudo service domoticz start. You can see in my attached screen shot
Can you please share the contents of /etc/init.d/domoticz.sh (between code tags please)

I think a step should be added in the build instructions and that is to copy from /dev-domoticz to the directory you are going to use for ' production'
You want to keep the production directory separated form your compile / development directory

something like

Code: Select all

source=/dev-domoticz
target=~/domoticz # or another target directory

sudo mkdir $target
sudo mkdir $target/backups
sudo mkdir $target/plugins

sudo rsync -I $source/domoticz $target/domoticz

sudo rsync -rI $source/www/ $target/www
sudo rsync -rI $source/dzVents/ $target/dzVents
sudo rsync -rI $source/Config/ $target/Config
sudo rsync -rI $source/scripts/ $target/scripts
sudo rsync -rI $source/scripts/lua/ $target/scripts/lua
sudo rsync -rI $source/scripts/lua/xmlhandler/ $target/scripts/lua/xmlHandler

sudo rsync -I $source/History.txt $target
sudo rsync -I $source/License.txt $target
sudo rsync -I $source/server_cert.pem $target
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
jackwan1
Posts: 41
Joined: Saturday 15 April 2017 20:04
Target OS: Linux
Domoticz version: 2020.2
Location: USA
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by jackwan1 »

here you go
domoticz.txt
(4.33 KiB) Downloaded 29 times
waaren wrote: Monday 11 May 2020 22:42
Can you please share the contents of /etc/init.d/domoticz.sh (between code tags please)

I think a step should be added in the build instructions and that is to copy from /dev-domoticz to the directory you are going to use for ' production'
You want to keep the production directory separated form your compile / development directory

something like

Code: Select all

source=/dev-domoticz
target=~/domoticz # or another target directory

sudo mkdir $target
sudo mkdir $target/backups
sudo mkdir $target/plugins

sudo rsync -I $source/domoticz $target/domoticz

sudo rsync -rI $source/www/ $target/www
sudo rsync -rI $source/dzVents/ $target/dzVents
sudo rsync -rI $source/Config/ $target/Config
sudo rsync -rI $source/scripts/ $target/scripts
sudo rsync -rI $source/scripts/lua/ $target/scripts/lua
sudo rsync -rI $source/scripts/lua/xmlhandler/ $target/scripts/lua/xmlHandler

sudo rsync -I $source/History.txt $target
sudo rsync -I $source/License.txt $target
sudo rsync -I $source/server_cert.pem $target
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by waaren »

jackwan1 wrote: Tuesday 12 May 2020 2:36 here you go
Can you change the DAEMON arg section with this snippet? It will start logging to /var/log/domoticz.log so you can see what happens

Code: Select all

DAEMON=/home/$USERNAME/domoticz/$NAME
DAEMON_ARGS="-daemon"
DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 18088"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"
DAEMON_ARGS="$DAEMON_ARGS -log /var/log/domoticz.log"
DAEMON_ARGS="$DAEMON_ARGS -loglevel  normal,status,error"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
jackwan1
Posts: 41
Joined: Saturday 15 April 2017 20:04
Target OS: Linux
Domoticz version: 2020.2
Location: USA
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by jackwan1 »

@waaren

U are absolutely correct. After I copied what you indicated below, domoticz started without any problem and I don't think the log is necessary. I can't edit the domoticz.sh file in the /etc/init.d/ anyway. right now the sh file in dev-domoticz has added log commands, but I don't think it is executed because there is no log files created in the directory. I still have few more questions.

1. right now should I start/stop domoticz using the sudo service domoticz start command or the sudo service domoticz.sh start command? I don't think I can do the sudo service domoticz start(or stop).
2. If I reboot the server, will domoticz load? I guess I should check it out.
3. Should I follow the wiki to set an auto update process using the git pull and make? If so, how often it will run, because I spent few hours to make this time, few months later, if the server is going to take hours to update, I or some one else might thought it is broken.
4. I backed up the settings in the old domoticz, how do I restore them into the new?

waaren wrote: Monday 11 May 2020 22:42
Can you please share the contents of /etc/init.d/domoticz.sh (between code tags please)

something like

Code: Select all

source=/dev-domoticz
target=~/domoticz # or another target directory

sudo mkdir $target
sudo mkdir $target/backups
sudo mkdir $target/plugins

sudo rsync -I $source/domoticz $target/domoticz

sudo rsync -rI $source/www/ $target/www
sudo rsync -rI $source/dzVents/ $target/dzVents
sudo rsync -rI $source/Config/ $target/Config
sudo rsync -rI $source/scripts/ $target/scripts
sudo rsync -rI $source/scripts/lua/ $target/scripts/lua
sudo rsync -rI $source/scripts/lua/xmlhandler/ $target/scripts/lua/xmlHandler

sudo rsync -I $source/History.txt $target
sudo rsync -I $source/License.txt $target
sudo rsync -I $source/server_cert.pem $target
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by waaren »

jackwan1 wrote: Tuesday 12 May 2020 20:59 I can't edit the domoticz.sh file in the /etc/init.d/ anyway.
If you copy the file from dev-domoticz/domoticz.sh to /etc/init.d/domoticz.sh you should be able to edit it
after editing

Code: Select all

sudo systemctl daemon-reload
sudo update-rc.d domoticz.sh defaults  #  enable the automatic start of domoticz 
sudo service domoticz stop
sudo service domoticz start
1. right now should I start/stop domoticz using the sudo service domoticz start command or the sudo service domoticz.sh start command? I don't think I can do the sudo service domoticz start(or stop).
sudo service domoticz start # should work after you did the above actions
2. If I reboot the server, will domoticz load? I guess I should check it out
See above
3. Should I follow the wiki to set an auto update process using the git pull and make? If so, how often it will run, because I spent few hours to make this time, few months later, if the server is going to take hours to update, I or some one else might thought it is broken.
A git pull only pulls the latest changes. The new make takes significant less time because most of the time it only needs to compile the changed sources and link the compiled objects.
On my system the initial compile (using a small Intel NUC takes 29 minutes when using make -j8) On average a make after a next git pull takes less then a minute.
4. I backed up the settings in the old domoticz, how do I restore them into the new?
You should be able to use the old database. Domoticz will apply the changes needed for your current version if the database is from a previous domoticz release. (I am not sure if that also works for a database used with domoticz V3.7 but it is worth a try)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
jackwan1
Posts: 41
Joined: Saturday 15 April 2017 20:04
Target OS: Linux
Domoticz version: 2020.2
Location: USA
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by jackwan1 »

@waaren

Ok. everything is working, including restore database and load domoticz on reboot. Thank you.

I tried to issue commands for updater described in the wiki. I have few problems

1. there is no monit in /etc/init.d/, perhaps it is an outdated reference not used today?
2. if I goto ~/domoticz and issue git pull, it will not execute because there is no repository
3. I have to goto ~/dev-domoticz to issue that git pull, but it will list a group of new files and asking for commit. I guess options -merge and -commit should be used for the git command
4. Even I can make the git pull, I guess I have to copy (rsync) from the dev subdirectory to domoticz subdirectory as you have posted before.
5. If I login as root and created the updater.sh in the root directory and sh it in the root directory, so sudo will not be used and password need not to be entered and I guess it will be installed as a corn job and will be processed every so often. of course, syntax must be correct first.


Not sure my above thinking is correct or not, nevertheless, if I am right, the wiki should be updated.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: update domoticz from 3.7 (2017 version)

Post by waaren »

jackwan1 wrote: Wednesday 13 May 2020 0:23 @waaren

Ok. everything is working, including restore database and load domoticz on reboot. Thank you.

I tried to issue commands for updater described in the wiki. I have few problems

1. there is no monit in /etc/init.d/, perhaps it is an outdated reference not used today?
monit is a separate tool; not directly related to domoticz. Did you do a sudo apt install monit?
2. if I goto ~/domoticz and issue git pull, it will not execute because there is no repository
you should do this while in domoticz-dev or the directory where all your sources are.
3. I have to goto ~/dev-domoticz to issue that git pull, but it will list a group of new files and asking for commit. I guess options -merge and -commit should be used for the git command
No a git pull should be enough. Can you try with a sudo git stash before the push? If no luck then please show what you see.
4. Even I can make the git pull, I guess I have to copy (rsync) from the dev subdirectory to domoticz subdirectory as you have posted before.
. Yes after the make you have to rsync again
5. If I login as root and created the updater.sh in the root directory and sh it in the root directory, so sudo will not be used and password need not to be entered and I guess it will be installed as a corn job and will be processed every so often. of course, syntax must be correct first.
Don't understand but guess this is not specific to domoticz but generic linux.
Not sure my above thinking is correct or not, nevertheless, if I am right, the wiki should be updated.
The wiki is for all of us and also from all of us. If you think it should be updated. Please send me a PM with an email address and preferred user-id and I wil creat an account for you so you can update the pages that are not complete yet.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest