Upgrade instructions

Forum for questions and support relating to the 1.30.x releases only.
Locked
Russkil
Posts: 15
Joined: Fri Jun 16, 2017 9:27 am

Upgrade instructions

Post by Russkil »

Hi All

This question may have been asked previously but I cannot seem to find the answer easierly.

What is the easiest way to perform a upgrade to the latest version with the ability to roll back if needed?

Also is there any easy way of exporting the config etc from one server and placing it on another so a "offline" upgrade of a server can take place to see if there is a issue with a second copy?

Thanks

Russ
montagdude
Posts: 88
Joined: Fri Nov 10, 2017 6:05 pm

Re: Upgrade instructions

Post by montagdude »

For backing up and migrating the database, see this post:
Flash_ wrote: Mon Mar 07, 2011 6:37 am Actually, that is often a lot of faff since phpmyadmin won't accept large incoming files to restore. You can copy the dumpfile locally and import from there, but even then often times out.

If you just want the setup and not the events, then phpmyadmin is handy since you just select all the tables except events (the really large one) and do as PacoLM says.

If copying the lot though;

Code: Select all

mysqldump --user=XXXXXXXX --password=XXXXXXX --databases zm > /PATH/TO/DUMPFILE.SQL
That creates DUMPFILE.SQL containing everything from zm's database. Copy that file to the new machine with zoneminder already installed (but stopped) and add it to mysql with;

Code: Select all

mysql  --user=XXXXXXXX --password=XXXXXXXX zm < /PATH/TO/DUMPFILE.SQL
Remember to copy turn off zm before importing the new db, and to copy across all the jpg files (/var/cache/zoneminder by default). If you don't copy across the jpgs, zmaudit will kill all your new events as orphans. (But will keep your events, monitors etc)

Only when both bits are installed can you restart zm and check all is good.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Upgrade instructions

Post by bbunge »

Besides the database, upgrade instructions may depend upon your Linux Distro and version. We ask you to state this in your post so we know where to start.

As for saving what you have just in case may I recommend clonezilla and take an image of your entire system. Sure, this may require time and disk space but it is a sure way to keep what you have. I speak from experience...
Russkil
Posts: 15
Joined: Fri Jun 16, 2017 9:27 am

Re: Upgrade instructions

Post by Russkil »

ok, thanks for the info so far this is obviously pushing me in the right direction. Double checking Linux distro its CentOS release 6.8 (Final), looking at https://zoneminder.readthedocs.io/en/la ... l-centos-6 it suggests theres a issue between zoneminder and centos, is this still true?

Read the notes on the upgrade so if i was going from one machine build to another I would build a new machine with just mysql on it and the move the sql backup(dump File) from one machine to the other and overlay the new install. With the new install do i need to install the same zoneminder version on the old server and then upgrade or can I install the new version and perform some actions to update the db?

on a small note if I cannot find the UN and PW of the Mysql install is this held in the zoneminder files anywhere?
Russkil
Posts: 15
Joined: Fri Jun 16, 2017 9:27 am

Re: Upgrade instructions

Post by Russkil »

just found info on username and password so will use this https://wiki.zoneminder.com/Access_denied_for_user. if someone could answer other questions that would be appreciated.
Russkil
Posts: 15
Joined: Fri Jun 16, 2017 9:27 am

Re: Upgrade instructions

Post by Russkil »

right I have just performed instructions rely on install having wget installed(yum install wget) and ethernet card being set to yes /etc/sysconfig/network-scripts/ifcfg-eth0

1) on old install run mysqldump --single-transaction --user=XXxxx --password=xxxxxx --databases zm > /PATH/TO/DUMPFILE.SQL via ssh
2) use winscp to download dump file from old machine
3) use winscp to upload dumpfile to upload to new machine
4) install zoneminder
wget http://zmrepo.zoneminder.com/el/6/i386/ ... noarch.rpm
sudo yum install --nogpgcheck zmrepo-6-7.el6.noarch.rpm
sudo yum install zoneminder
less /usr/share/doc/zoneminder-*/README.Redhat6

5) Install SQL
sudo yum install mysql-server
sudo service mysqld start
/usr/bin/mysql_secure_installation
sudo chkconfig mysqld on

6) Configure SQL

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant all on zm.* to \
'zmuser'@localhost identified by 'zmpass';"
mysqladmin -uroot -p reload

7) run mysql --user=XXXXXXXX --password=XXXXXXXX zm < /PATH/TO/DUMPFILE.SQL
7a) restore events from old machine ?
8) edit date.timezone in /etc/php.ini to Europe/London (vi commands needed)
9) sudo yum install mod_ssl
10) sudo zmupdate.pl
11) Configure the web server

sudo chkconfig httpd on
sudo service httpd start

12) sudo service zoneminder start
13) service iptables stop

and have ended up with a zoneminder blank screen even after enabling short tags in php.

any ideas?
Locked