Upgrading from 1.36.x to 1.36.33 on Debian

Add any particular hints or tricks you have found to help with your ZoneMinder experience.
Post Reply
Greg_Talyor
Posts: 34
Joined: Mon Aug 17, 2020 7:41 pm

Upgrading from 1.36.x to 1.36.33 on Debian

Post by Greg_Talyor »

I had installed Zoneminder three years ago. I thank Isaac Connor and his team that it works so well. I have updated my installation for the first time to 1.36.33 this week. It is not much, but I hope my experience would help novices like me. It is based on one installation on one machine by one person. So, corrections and suggestions are welcome.
  • Three years ago, I had installed Zoneminder 1.36.3[?] on Debian 11 Bullseye. I followed the instructions here. https://zoneminder.readthedocs.io/en/la ... 1-bullseye
  • If you are running a new installation, follow the instructions for Debian 12 Bookworm. If you are upgrading an existing installation, please read on. https://zoneminder.readthedocs.io/en/la ... 2-bookworm
  • Debian issue: This is not a Zoneminder issue. From Debian 12 Bookworm, they have split non-free into non-free and non-free-firmware. Your /etc/apt/sources.list should have a couple of lines similar to the follows.

    Code: Select all

    deb	http://deb.debian.org/debian/				bookworm-updates    main contrib non-free non-free-firmware
    deb	https://zmrepo.zoneminder.com/debian/release-1.36	bookworm/
    
  • Zoneminder PGP public key has been changed since January 2023. So when running sudo apt-get update as the above, you will encounter an error. Enter the follow line to fetch the new signing key. Then, do an update and an upgrade as you would usually do on a Debian machine.

    Code: Select all

    wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | sudo tee /etc/apt/trusted.gpg.d/zmrepo.asc
    sudo apt-get update
    sudo apt-get upgrade
    
    viewtopic.php?t=32308
  • There are new fields used in 1.36.16 and 1.36.18. You will need to access your MySQL or MariaDB database. If you had followed the standard installation procedure, default username is zmuser, password is zmpass and database name is zm as in /etc/zm/zm.conf .

    Code: Select all

    mysql -u zmuser -p
    
  • In MySQL or MariaDB, enter:

    Code: Select all

    zmpass
    use zm
    source /usr/share/zoneminder/db/zm_update-1.36.16.sql
    source /usr/share/zoneminder/db/zm_update-1.36.18.sql
    quit
    
  • Restart Zoneminder and double check that it works the way you expect.

    Code: Select all

    sudo zmupdate.pl -f
    sudo systemctl restart zoneminder.service
    sudo systemctl status zoneminder.service
    
  • Below is a screen dump.

    Code: Select all

    $ mysql -u zmuser -p
    Enter password: zmpass
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 1234
    Server version: 10.11.3-MariaDB-1 Debian 12
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> use zm
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    
    MariaDB [zm]> source /usr/share/zoneminder/db/zm_update-1.36.16.sql
    +-------------------------------+
    | Checking for System in Config |
    +-------------------------------+
    | Checking for System in Config |
    +-------------------------------+
    1 row in set (0.000 sec)
    ...
    
    MariaDB [zm]> source /usr/share/zoneminder/db/zm_update-1.36.18.sql
    +--------------------------------+
    | Checking for Private in Config |
    +--------------------------------+
    | Checking for Private in Config |
    +--------------------------------+
    1 row in set (0.000 sec)
    ...
    
    MariaDB [zm]> quit
    Bye
    
    $ sudo zmupdate.pl -f
    Freshening configuration in database
    Migratings passwords, if any...
    Loading config from DB 221 entries
    Saving config to DB 227 entries
    
    $ sudo systemctl restart zoneminder.service
    $ sudo systemctl status zoneminder.service
    ● zoneminder.service - ZoneMinder CCTV recording and surveillance system
         Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; preset: enabled)
         Active: active (running) since Tue 2023-08-08 23:57:10 XXX; 3s ago
           Docs: http://zoneminder.readthedocs.org/en/latest/
        Process: 8386 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=0/SUCCESS)
       Main PID: 8397 (zmdc.pl)
          Tasks: 12 (limit: 9311)
         Memory: 215.1M
            CPU: 2.556s
         CGroup: /system.slice/zoneminder.service
                 ├─8397 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
                 ├─8424 /usr/bin/zmc -m 1
                 ├─8428 /usr/bin/zmc -m 2
                 ├─8432 /usr/bin/zmc -m 3
                 ├─8436 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=1 --daemon
                 ├─8440 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=2 --daemon
                 ├─8445 /usr/bin/perl -wT /usr/bin/zmwatch.pl
                 ├─8449 /usr/bin/perl -wT /usr/bin/zmupdate.pl -c
                 └─8453 /usr/bin/perl -wT /usr/bin/zmstats.pl
    
    Aug 08 23:57:08 foobar systemd[1]: Starting zoneminder.service - ZoneMinder CCTV recording and surveillance system...
    Aug 08 23:57:10 foobar systemd[1]: Started zoneminder.service - ZoneMinder CCTV recording and surveillance system.
    
The above is mostly based on an answer by by _zot_ on Fri Aug 12, 2022 9:33 pm. viewtopic.php?p=131383#p131383

Ta.
Last edited by Greg_Talyor on Sun Aug 13, 2023 10:48 pm, edited 3 times in total.
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Upgrading from 1.36x to 1.36.33 on Debian

Post by iconnor »

Good writeup, should be of use to people.

One thing to note is that the db updates should be automatically done by running the zmupdate.pl script. It basically does what you did here, but in an automated fashion. If there was a problem along the way and updates didn't get applied, then your manual method may be required, so good to document that.
Post Reply