How to DOWNGRADE 1.32 database to 1.30.4?

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
jbg70
Posts: 19
Joined: Tue Dec 30, 2008 9:00 am

How to DOWNGRADE 1.32 database to 1.30.4?

Post by jbg70 » Sat Sep 22, 2018 4:53 pm

Hi,
new 1.32 has better web interface and some interesting new features, but CPU load went up from 1.2 to 2.6 and it is not really stable.
I have lots of archived events and I tried to restore the 1.32 database into new created db with zm 1.30.4, but zoneminder crashes when start capturing, reporting this error:

Code: Select all

zmc_m1[2241]: ERR [Can't run query: Unknown column 'AnalysisFPS' in 'field list']
Is there any way to roll back database to 1.30.4 without losing archived events?

Thanks.

jbg70
Posts: 19
Joined: Tue Dec 30, 2008 9:00 am

Re: How to DOWNGRADE 1.32 database to 1.30.4?

Post by jbg70 » Sat Sep 22, 2018 8:58 pm

Solved...

I created a new empty db from 1.30.4, and I restored on it a backup of the db updated by 1.32.
In zm database, in "Monitors" table I changed the Field name "AnalysisFPSLimit" to "AnalysisFPS".
Now version 1.30.4 looks to be working again.

rockedge
Posts: 1073
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA
Contact:

Re: How to DOWNGRADE 1.32 database to 1.30.4?

Post by rockedge » Sun Sep 23, 2018 5:16 pm

nice work! :D

Tantamount
Posts: 71
Joined: Wed Feb 03, 2016 7:51 am

Re: How to DOWNGRADE 1.32 database to 1.30.4?

Post by Tantamount » Wed Oct 31, 2018 3:27 am

I just had to do this myself. I solve the problem in a slightly different way...

I ran zmupdate.pl

it "upgraded" from 1.32 to 1.30. :)

Code: Select all

[root@zoneminder db]# zmupdate.pl
Use of uninitialized value $Config{"ZM_DIR_EVENTS"} in pattern match (m//) at /usr/bin/zmupdate.pl line 81.
Use of uninitialized value in concatenation (.) or string at /usr/bin/zmupdate.pl line 81.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/vendor_perl/ZoneMinder/Logger.pm line 154.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/vendor_perl/ZoneMinder/Logger.pm line 199.

Initiating database upgrade to version 1.30.4 from version 1.32.1

Please ensure that ZoneMinder is stopped on your system prior to upgrading the database.
Press enter to continue or ctrl-C to stop : 

Do you wish to take a backup of your database prior to upgrading?
This may result in a large file in /var/lib/zoneminder/temp if you have a lot of events.
Press 'y' for a backup or 'n' to continue : y
Creating backup to /var/lib/zoneminder/temp/zm-1.32.1.dump. This may take several minutes.
Database successfully backed up to /var/lib/zoneminder/temp/zm-1.32.1.dump, proceeding to upgrade.

Upgrading database to version 1.30.4
Loading config from DB
No option 'ZM_AUTH_HASH_TTL' found, removing.
No option 'ZM_BANDWIDTH_DEFAULT' found, removing.
No option 'ZM_HOME_CONTENT' found, removing.
No option 'ZM_HOME_URL' found, removing.
No option 'ZM_MIN_STREAMING_PORT' found, removing.
No option 'ZM_OPT_USE_EVENTNOTIFICATION' found, removing.
No option 'ZM_SHOW_PRIVACY' found, removing.
No option 'ZM_STATS_UPDATE_INTERVAL' found, removing.
No option 'ZM_TELEMETRY_INTERVAL' found, removing.
No option 'ZM_TELEMETRY_SERVER_ENDPOINT' found, removing.
No option 'ZM_TIMESTAMP_CODE_CHAR' found, removing.
No option 'ZM_WEB_FILTER_SOURCE' found, removing.
No option 'ZM_WEB_H_REFRESH_NAVBAR' found, removing.
No option 'ZM_WEB_L_REFRESH_NAVBAR' found, removing.
No option 'ZM_WEB_M_REFRESH_NAVBAR' found, removing.
No option 'ZM_WEB_TITLE' found, removing.
No option 'ZM_WEB_XFRAME_WARN' found, removing.
Saving config to DB

Database upgrade to version 1.30.4 successful.
I did have to rename that one Monitors column too though... I think this was the sql command I used:

alter Table `Monitors` change column `AnalysisFPSLimit` `AnalysisFPS` decimal(2,5);
2 LaView LV-PB932F4
4 ReoLink RLC-411
CentOS 7.4 - 8 Core Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 16 Gigs ram (Running under XenServer as a VM)
ZoneMinder Version : 1.31.1 Release : 1.320.20180206gitga177d8e9.el7.centos

lbdroid
Posts: 5
Joined: Thu Nov 01, 2018 3:03 pm

Re: How to DOWNGRADE 1.32 database to 1.30.4?

Post by lbdroid » Thu Nov 01, 2018 3:54 pm

jbg70 wrote:
Sat Sep 22, 2018 4:53 pm
Hi,
new 1.32 has better web interface and some interesting new features, but CPU load went up from 1.2 to 2.6 and it is not really stable.
I have lots of archived events and I tried to restore the 1.32 database into new created db with zm 1.30.4, but zoneminder crashes when start capturing, reporting this error:

Code: Select all

zmc_m1[2241]: ERR [Can't run query: Unknown column 'AnalysisFPS' in 'field list']
Is there any way to roll back database to 1.30.4 without losing archived events?

Thanks.
Did you look at all into *why* the CPU load increased? My observation with regards to 1.32 is that it defaults to using x264 encoding to store videos, whereas 1.30 used jpeg exclusively. This could result in a significant change in CPU load, but can be reset to 1.30 behavior in the storage tab of the monitor configuration page. I don't know if that change is automatically applied on an upgrade, or if it is just for newly created monitors.

rwg
Posts: 1
Joined: Sat Jan 12, 2019 8:28 pm

Re: How to DOWNGRADE 1.32 database to 1.30.4?

Post by rwg » Sat Jan 12, 2019 8:47 pm

Hi,

Just wanted to say thank you for the suggestions here on how to downgrade. My upgrade from 1.30.4 to 1.32 didn't end well – with web related errors that I could properly fixed but also my monitors kept stopping and staying stopped which had never happened in the older version. Fortunately etckeeper had kept my previous configuration in /etc and I found a copy of the older install package here – https://www.hoelzle.net/zoneminder-1-30 ... -mit-lamp/. The alter table command above managed to fix my database to be compatible with the older version (although it should be decimal(5,2) not decimal (2,5)). The only other thing I had to fix was in passing the options and now my system is working again.

In case it's any use to anyone, here are my syslog entries that might be relevant to the problem of the monitor stopping.

Code: Select all

Jan 12 06:58:33 puss zmdc[2354]: ERR ['zmc -m 1' exited abnormally, exit status 255]
Jan 12 06:58:53 puss zmwatch[3930]: ERR [Error getting last capture time for  Front]
Jan 12 13:37:35 puss zmdc[2354]: ERR ['zmc -m 1' exited abnormally, exit status 255]
Jan 12 13:37:55 puss zmwatch[3930]: ERR [Error getting last capture time for  Front]
Jan 12 14:25:58 puss zmdc[2354]: ERR ['zmc -m 6' exited abnormally, exit status 255]
Jan 12 14:26:13 puss zmwatch[3930]: ERR [Memory map file '/dev/shm/zm.mmap.6' does not exist.  zmc might not be running.]
Jan 12 14:26:13 puss zmdc[2354]: ERR ['zmc -m 6' exited abnormally, exit status 255]
Jan 12 14:26:28 puss zmwatch[3930]: ERR [Error getting last capture time for  Front-continuous]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Got signal 11 (Segmentation fault), crashing]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Signal address is (nil), from 0x7f979c32098d]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Backtrace 0: /usr/bin/zma(_Z14zm_die_handleriP9siginfo_tPv+0x78) [0x5592b7688118]]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Backtrace 1: /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890) [0x7f97a002c890]]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Backtrace 2: /lib/x86_64-linux-gnu/libc.so.6(cfree+0x3d) [0x7f979c32098d]]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Backtrace 3: /usr/bin/zma(_ZN12LibvlcCameraD1Ev+0x7d) [0x5592b76c394d]]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Backtrace 4: /usr/bin/zma(_ZN12LibvlcCameraD0Ev+0x9) [0x5592b76c39e9]]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Backtrace 5: /usr/bin/zma(_ZN7MonitorD1Ev+0x1d2) [0x5592b763e472]]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Backtrace 6: /usr/bin/zma(main+0x40c) [0x5592b7606b2c]]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Backtrace 7: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f979c2aab97]]
Jan 12 16:27:00 puss zma_m4[3803]: ERR [Backtrace 8: /usr/bin/zma(_start+0x2a) [0x5592b760746a]]
Jan 12 16:27:00 puss zmdc[2354]: ERR ['zma -m 4' exited abnormally, exit status 11]
Jan 12 16:27:42 puss zma_m1[10277]: ERR [zma_m1] [Shared data not initialised by capture daemon for monitor Front]
Jan 12 16:27:42 puss zmdc[10201]: ERR ['zma -m 1' exited abnormally, exit status 255]
Jan 12 16:35:56 puss zma_m4[16230]: ERR [zma_m4] [Got empty memory map file size 0, is the zmc process for this monitor running?]
Jan 12 16:35:56 puss zmdc[10201]: ERR ['zma -m 4' exited abnormally, exit status 255]
Jan 12 16:35:57 puss zma_m4[16231]: ERR [zma_m4] [Got empty memory map file size 0, is the zmc process for this monitor running?]
Jan 12 16:35:57 puss zmdc[10201]: ERR ['zma -m 4' exited abnormally, exit status 255]
Jan 12 16:35:59 puss zmwatch[10353]: ERR [Memory map file '/dev/shm/zm.mmap.4' should have been 1160 but was instead 0]
Jan 12 16:58:16 puss zmc_m1[10271]: ERR [zmc_m1] [Unable to send packet at frame 8905: Resource temporarily unavailable, continuing]
Jan 12 16:59:50 puss zma_m7[30180]: ERR [zma_m7] [Got empty memory map file size 0, is the zmc process for this monitor running?]
Jan 12 16:59:50 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 16:59:55 puss zma_m7[30228]: ERR [zma_m7] [Got empty memory map file size 0, is the zmc process for this monitor running?]
Jan 12 16:59:55 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 16:59:56 puss zma_m7[30229]: ERR [zma_m7] [Got empty memory map file size 0, is the zmc process for this monitor running?]
Jan 12 16:59:56 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 17:00:00 puss zmwatch[10353]: ERR [Memory map file '/dev/shm/zm.mmap.7' should have been 1160 but was instead 0]
Jan 12 17:00:01 puss zma_m7[30267]: ERR [zma_m7] [Shared data not initialised by capture daemon for monitor Garage-Door]
Jan 12 17:00:01 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 17:00:02 puss zma_m7[30675]: ERR [zma_m7] [Shared data not initialised by capture daemon for monitor Garage-Door]
Jan 12 17:00:02 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 17:00:06 puss zma_m7[31224]: ERR [zma_m7] [Shared data not initialised by capture daemon for monitor Garage-Door]
Jan 12 17:00:06 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 17:00:07 puss zma_m7[31328]: ERR [zma_m7] [Shared data not initialised by capture daemon for monitor Garage-Door]
Jan 12 17:00:07 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 17:00:16 puss zma_m7[31423]: ERR [zma_m7] [Got empty memory map file size 0, is the zmc process for this monitor running?]
Jan 12 17:00:16 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 17:00:22 puss zma_m7[31476]: ERR [zma_m7] [Got empty memory map file size 0, is the zmc process for this monitor running?]
Jan 12 17:00:22 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 17:00:23 puss zma_m7[31478]: ERR [zma_m7] [Got empty memory map file size 0, is the zmc process for this monitor running?]
Jan 12 17:00:23 puss zmdc[10201]: ERR ['zma -m 7' exited abnormally, exit status 255]
Jan 12 17:00:27 puss zmwatch[10353]: ERR [Memory map file '/dev/shm/zm.mmap.7' should have been 1160 but was instead 0]
Jan 12 17:00:27 puss zma_m7[31518]: ERR [zma_m7] [Shared data not initialised by capture daemon for monitor Garage-Door]
I upgraded at 4:27 PM and the first monitor stopping problem occurred at about 5 PM. Most of the individual ZMA/ZMC logs appear to be zero bytes at the moment for today so I don't have any information from those logs, but the ZMDC log seems to indicate it was trying to restart the monitor and failing. Here is a sample

Code: Select all

12/01/19 16:35:59.356251 zmdc[16240].INF [ZMServer:404] ['zma -m 4' started at 19/01/12 16:35:59]
no memkey in zmMemInvalidate
12/01/19 16:59:50.287772 zmdc[10201].INF [ZMServer:404] ['zma -m 7' sending stop to pid 10319 at 19/01/12 16:59:50]
12/01/19 16:59:50.317541 zmdc[10201].INF [ZMServer:692] ['zma -m 7' exited normally]
12/01/19 16:59:50.379698 zmdc[10201].INF [ZMServer:404] ['zmc -m 7' sending stop to pid 10314 at 19/01/12 16:59:50]
12/01/19 16:59:50.444193 zmdc[10201].INF [ZMServer:692] ['zmc -m 7' exited normally]
12/01/19 16:59:50.473614 zmdc[10201].INF [ZMServer:404] ['zma -m 7' starting at 19/01/12 16:59:50, pid = 30180]
12/01/19 16:59:50.473618 zmdc[30180].INF [ZMServer:404] ['zma -m 7' started at 19/01/12 16:59:50]
12/01/19 16:59:50.483002 zmdc[10201].INF [ZMServer:404] [Starting pending process, zmc -m 7]
12/01/19 16:59:50.486539 zmdc[10201].INF [ZMServer:404] ['zmc -m 7' starting at 19/01/12 16:59:50, pid = 30181]
12/01/19 16:59:50.486542 zmdc[30181].INF [ZMServer:404] ['zmc -m 7' started at 19/01/12 16:59:50]
12/01/19 16:59:50.514349 zmdc[10201].ERR [ZMServer:694] ['zma -m 7' exited abnormally, exit status 255]
12/01/19 16:59:51.521901 zmdc[10201].INF [ZMServer:404] [Starting pending process, zma -m 7]
12/01/19 16:59:51.533426 zmdc[10201].INF [ZMServer:404] ['zma -m 7' starting at 19/01/12 16:59:51, pid = 30182]
12/01/19 16:59:51.533442 zmdc[30182].INF [ZMServer:404] ['zma -m 7' started at 19/01/12 16:59:51]
12/01/19 16:59:55.609230 zmdc[10201].INF [ZMServer:404] ['zma -m 7' sending stop to pid 30182 at 19/01/12 16:59:55]
12/01/19 16:59:55.615063 zmdc[10201].INF [ZMServer:692] ['zma -m 7' exited, signal 14]
12/01/19 16:59:55.693516 zmdc[10201].INF [ZMServer:404] ['zmc -m 7' sending stop to pid 30181 at 19/01/12 16:59:55]
12/01/19 16:59:55.728290 zmdc[10201].INF [ZMServer:692] ['zmc -m 7' exited normally]
12/01/19 16:59:55.788090 zmdc[30228].INF [ZMServer:404] ['zma -m 7' started at 19/01/12 16:59:55]
12/01/19 16:59:55.788087 zmdc[10201].INF [ZMServer:404] ['zma -m 7' starting at 19/01/12 16:59:55, pid = 30228]
12/01/19 16:59:55.830413 zmdc[10201].ERR [ZMServer:694] ['zma -m 7' exited abnormally, exit status 255]
12/01/19 16:59:56.837595 zmdc[10201].INF [ZMServer:404] [Starting pending process, zma -m 7]
12/01/19 16:59:56.844171 zmdc[10201].INF [ZMServer:404] ['zma -m 7' starting at 19/01/12 16:59:56, pid = 30229]
12/01/19 16:59:56.844179 zmdc[30229].INF [ZMServer:404] ['zma -m 7' started at 19/01/12 16:59:56]
12/01/19 16:59:56.898702 zmdc[10201].ERR [ZMServer:694] ['zma -m 7' exited abnormally, exit status 255]
12/01/19 17:00:00.910490 zmdc[10201].INF [ZMServer:404] [Starting pending process, zmc -m 7]
12/01/19 17:00:00.914008 zmdc[10201].INF [ZMServer:404] ['zmc -m 7' starting at 19/01/12 17:00:00, pid = 30262]
12/01/19 17:00:00.914039 zmdc[30262].INF [ZMServer:404] ['zmc -m 7' started at 19/01/12 17:00:00]
12/01/19 17:00:00.921047 zmdc[10201].INF [ZMServer:404] [Command 'zma -m 7' removed from pending list at 19/01/12 17:00:00]
12/01/19 17:00:01.014542 zmdc[10201].INF [ZMServer:404] ['zmc -m 7' sending stop to pid 30262 at 19/01/12 17:00:01]
12/01/19 17:00:01.020998 zmdc[10201].INF [ZMServer:692] ['zmc -m 7' exited, signal 14]
12/01/19 17:00:01.087989 zmdc[10201].INF [ZMServer:404] ['zma -m 7' starting at 19/01/12 17:00:01, pid = 30267]
12/01/19 17:00:01.087992 zmdc[30267].INF [ZMServer:404] ['zma -m 7' started at 19/01/12 17:00:01]
no memkey in zmMemInvalidate
12/01/19 17:00:01.133238 zmdc[10201].ERR [ZMServer:694] ['zma -m 7' exited abnormally, exit status 255]
12/01/19 17:00:02.140453 zmdc[10201].INF [ZMServer:404] [Starting pending process, zma -m 7]
12/01/19 17:00:02.144039 zmdc[30675].INF [ZMServer:404] ['zma -m 7' started at 19/01/12 17:00:02]
12/01/19 17:00:02.144038 zmdc[10201].INF [ZMServer:404] ['zma -m 7' starting at 19/01/12 17:00:02, pid = 30675]
12/01/19 17:00:02.188182 zmdc[10201].ERR [ZMServer:694] ['zma -m 7' exited abnormally, exit status 255]
12/01/19 17:00:06.177821 zmdc[10201].INF [ZMServer:404] [Command 'zma -m 7' removed from pending list at 19/01/12 17:00:06]
12/01/19 17:00:06.250347 zmdc[10201].INF [ZMServer:404] [Command 'zmc -m 7' removed from pending list at 19/01/12 17:00:06]
12/01/19 17:00:06.322351 zmdc[10201].INF [ZMServer:404] ['zma -m 7' starting at 19/01/12 17:00:06, pid = 31224]
12/01/19 17:00:06.322353 zmdc[31224].INF [ZMServer:404] ['zma -m 7' started at 19/01/12 17:00:06]
12/01/19 17:00:06.360747 zmdc[10201].ERR [ZMServer:694] ['zma -m 7' exited abnormally, exit status 255]
12/01/19 17:00:07.368791 zmdc[10201].INF [ZMServer:404] [Starting pending process, zma -m 7]
12/01/19 17:00:07.378868 zmdc[31328].INF [ZMServer:404] ['zma -m 7' started at 19/01/12 17:00:07]
12/01/19 17:00:07.378857 zmdc[10201].INF [ZMServer:404] ['zma -m 7' starting at 19/01/12 17:00:07, pid = 31328]
12/01/19 17:00:07.452026 zmdc[10201].ERR [ZMServer:694] ['zma -m 7' exited abnormally, exit status 255]
12/01/19 17:00:11.450326 zmdc[10201].INF [ZMServer:404] [Command 'zma -m 7' removed from pending list at 19/01/12 17:00:11]
12/01/19 17:00:11.522479 zmdc[10201].WAR [ZMServer:406] [Can't find process with command of 'zmc -m 7']
12/01/19 17:00:11.531144 zmdc[10201].INF [ZMServer:404] ['zmc -m 7' starting at 19/01/12 17:00:11, pid = 31333]
12/01/19 17:00:11.531152 zmdc[31333].INF [ZMServer:404] ['zmc -m 7' started at 19/01/12 17:00:11]
12/01/19 17:00:11.624354 zmdc[10201].INF [ZMServer:404] ['zma -m 7' starting at 19/01/12 17:00:11, pid = 31342]
12/01/19 17:00:11.625970 zmdc[31342].INF [ZMServer:404] ['zma -m 7' started at 19/01/12 17:00:11]
12/01/19 17:00:16.743223 zmdc[10201].INF [ZMServer:404] ['zma -m 7' sending stop to pid 31342 at 19/01/12 17:00:16]
12/01/19 17:00:16.746572 zmdc[10201].INF [ZMServer:692] ['zma -m 7' exited, signal 14]
12/01/19 17:00:16.817760 zmdc[10201].INF [ZMServer:404] ['zmc -m 7' sending stop to pid 31333 at 19/01/12 17:00:16]
12/01/19 17:00:16.857274 zmdc[10201].INF [ZMServer:692] ['zmc -m 7' exited normally]

Anyway, thanks again for posting the downgrade information.

Robin

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest