Upgrade procedure from 1.23.3 to 1.24.1 - and distro change

Forum for questions and support relating to the 1.24.x releases only.
Locked
User avatar
robi
Posts: 477
Joined: Sat Mar 17, 2007 10:48 am

Upgrade procedure from 1.23.3 to 1.24.1 - and distro change

Post by robi »

Hello folks!

I intend to upgrade my ZM box form Mandriva 2007 to OpenSUSE 11.1.
The Mandriva installation was created 16 months ago from Ross's LiveCD, and updated over time to ZM 1.23.3. It worked very well and still does. On the new system I'd like to use the current ZM 1.24.1, which I'd install based on this post.

I need to do the upgrade because the installation is getting pretty old now, I use the box not only for ZM but for a couple more projects and finding packages with new software is more and more harder for this old distro. Plus, I have 2 spare 250GB SATA disks I wish to add to the system, and this old thing just doesn't support SATA...

I chose OpenSUSE because it looked pretty stable on a test machine I installed it onto, and seems to have most packages I need these days to my work, however, if any of you gurus can recommend any other good and easy-to-maintain distro, I'm happy to hear your opinions. I'm definitely not a Linux tech, I came from a Windoze world, and although I can type at the prompt basic things, I usually solve things in the GUI way...

And now, to the point, as I imagined I'd do it:
- I will do a complete reinstallation of the system, with the two new disks in it, and the original one with Mandriva 2007 pulled out, just in case, to make sure I don't mess anything up (if something goes wrong, I'd just put the old disk back and everything would remain working).
- Since OpenSUSE uses a different Filesystem Hierarchy Standard than Mandriva, I need to re-organize things a bit (/srv/www instead of /var/www, etc). On the old system I wasn't exactly aware of how I'd use the space, I'd do it differently this time. I'd partition the first 250GB disk for swap, /, and the usual things, a separate partition for /srv/www, and mount the second 250GB disk entirely to /srv/www/zm (is that the place where ZM places things under OpenSUSE? Should i better assign it to /srv/www/zm/events?)(The old disk was about 200GB and I had a 160GB partition for /var)
This way I'd dedicate an entire disk to ZM data, and use the system disk's last partition for other web applications and ftp (is it OK like this?).
- after setting all this up, installing OpenSUSE 11.1, and a fresh copy of ZM 1.24.1, I'd temporarily plug the old disk back in the system and restore data from the 1.23.3 ZM installation. I don't intend to let the old disk in, it worked non-stop for almost an year and a half, and it wasn't new when it gained this task, so I think it's time to retire this one...

My questions:
- what file system do you recommend for the disk mounted in /srv/www/zm? I used the Deep Storage option in ZM 1.23.3, and I intend to keep using it in 1.24.1. Is Ext3 fine for ZM data?
- should I copy the data from the old disk's /var/www/html/zm/events to the new disk (I think it would be /srv/www/zm/events)?
- how should I deal with the database restore from the previous version? also, how should I deal with the changed paths?

Among other things on the same box: ftp, ssh, asterisk, webmin, tightvnc, x... (last three for setup only)

I'd really appreciate any response, comment, suggestion or idea to my little project.
As far as I have a stable running 1.24.1, I promise to have the Hungarian tranlation updated too!

Thanks in advance!
v1.25.0 + Ubuntu Linux 12.04 Server
User avatar
monex
Posts: 169
Joined: Mon Jan 22, 2007 1:10 pm

Re: Upgrade procedure from 1.23.3 to 1.24.1 - and distro cha

Post by monex »

Hi,

I will give you some advices how to proceed in this case. You need from your old installation the events, the contents of the database and the zoneminder configuration file (/etc/zm.conf). To create a backup of the database you should use mysqldump e.g. mysqldump zm > zm.sql.
  1. install opensuse 11.1 and partition you hard drives as you like it. If you plan not to use the deep storage feature then I would prefer reiser for the zm events partition. Mount the zm partition to /srv.
  2. set up MySQL and Apache2 and don't forget to set a root password for MySQL ;)
  3. install ZoneMinder: use zypper, yast or whatever you like to use but don't run zm_database_init now.
  4. copy the contents of the events directory from your old installation to /srv/www/htdocs/zm/events (of course you can use symlinks instead).
  5. copy the zm.conf from your old installation to /etc make sure that the version in the zm.conf matches your old zoneminder version!!!! Set the other values so that the config looks like this:

    Code: Select all

    # Current version of ZoneMinder
    ZM_VERSION=<old version string)              
    
    # Path to build directory, used mostly for finding DB upgrade scripts
    # hack to db update skripts                                          
    ZM_PATH_BUILD=/usr/share/zm                                          
    
    # Build time, used to record when to trigger various checks
    ZM_TIME_BUILD=1168459485                                   
    
    # Path to ZoneMinder binaries
    ZM_PATH_BIN=/usr/bin         
    
    # Path to ZoneMinder libraries (none at present, for future use)
    ZM_PATH_LIB=/usr/local/lib                                      
    
    # Path to ZoneMinder configuration (this file only at present)
    ZM_PATH_CONF=/etc                                             
    
    # Path to ZoneMinder web files
    ZM_PATH_WEB=/srv/www/htdocs/zm
    
    # Path to ZoneMinder cgi files
    ZM_PATH_CGI=/srv/www/cgi-bin
    
    # Username and group that web daemon (httpd/apache) runs as
    ZM_WEB_USER=wwwrun
    ZM_WEB_GROUP=www
    
    # ZoneMinder database hostname or ip address
    ZM_DB_HOST=localhost
    
    # ZoneMinder database name
    ZM_DB_NAME=zm
    
    # ZoneMinder database user
    ZM_DB_USER=zm_admin
    
    # ZoneMinder database password
    ZM_DB_PASS=<secret>
    
    
  6. dump in your backup of the old zm database e.g. mysql zm < zm.sql
  7. create the user zm_admin for the zm database. You can use PhpMyAdmin for this task if you prefer GUI, or you can execute in mysql cli:

    Code: Select all

    GRANT USAGE ON * . * TO 'zm_admin'@'localhost' IDENTIFIED BY 'secret' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UP
    DATES_PER_HOUR 0 ; GRANT SELECT , INSERT , UPDATE , DELETE ON zm . * TO 'zm_admin'@'localhost';
    
    Make sure that the password specified here is the same as in your zm.conf
  8. now run zm_database_init, which should start the update process.
  9. start zoneminder by running rczm start.
I just want to mention a few words about zm_database_init: it is just a helper script which should make it easier to install and update the database. To test if an update is necessary it reads out the version string from /etc/zm.conf and runs zmupdate.pl with the correct values or dumps in the initial database. Of course you can also give the zm_admin MySQL user all privileges on database zm and then run zmupdate.pl -version=<old version> instead and remove /usr/share/zm/lock manual.

Maybe it could be easier if you update ZoneMinder before changing the distro :P

You should also have a look at
http://www.zoneminder.com/wiki/index.ph ... s_for_SuSE

Hope I didn't forgot anything. If you run into troubles then post back and you should keep your backups until it works correct ;)
Image
User avatar
robi
Posts: 477
Joined: Sat Mar 17, 2007 10:48 am

Re: Upgrade procedure from 1.23.3 to 1.24.1 - and distro cha

Post by robi »

Million thanks for the step-by-step guide. That's exaclty what I was hoping to get. One question though:
monex wrote:Mount the zm partition to /srv.
Isn't it possible to mount the ZM partition to /srv/www/htdocs/zm/events, or /srv/www/htdocs/zm? Because I will use other parts of /srv, like /srv/ftp, or different other folders in /srv/www/htdocs, for other services which may eat up the space of the ZM drive, causing to purge events earlier than it should. I'd like to dedicate 250GB on a separate disk, only to the events, and make sure nothing else goes on this partition.
v1.25.0 + Ubuntu Linux 12.04 Server
User avatar
monex
Posts: 169
Joined: Mon Jan 22, 2007 1:10 pm

Re: Upgrade procedure from 1.23.3 to 1.24.1 - and distro cha

Post by monex »

robi wrote: Isn't it possible to mount the ZM partition to /srv/www/htdocs/zm/events, or /srv/www/htdocs/zm? Because I will use other parts of /srv, like /srv/ftp, or different other folders in /srv/www/htdocs, for other services which may eat up the space of the ZM drive, causing to purge events earlier than it should. I'd like to dedicate 250GB on a separate disk, only to the events, and make sure nothing else goes on this partition.
Yes, of course this is possible. It is even possible to mount the disk elsewhere and using symlinks :)

Have a lot of fun
Image
Locked