Page 1 of 1

Migrate Zoneminder to new server

Posted: Wed Jun 26, 2019 12:05 pm
by ckilner
I've built a new Ubuntu 18.04LTS server and installed Apache, PHP, MariaDB and Zoneminder 1.32
I now want to migrate Zoneminder from the old server to the new one without losing any events etc.

Is this an easy/possible thing to do?

Re: Migrate Zoneminder to new server

Posted: Wed Jun 26, 2019 8:22 pm
by snake
Easiest thing to do when migrating is to copy the Monitor configurations only. That will save you if you have greather than a few cameras, from reconfiguring everything. You can backup the old db with mysqldump, restore it to the new server, and then run zmupdate.pl which will auto update the db to 1.32+

You can either copy just the Monitors table, or copy everything. I think some of the fields don't carry over if you just copy Monitors, so I copy everything.
Steps

Code: Select all

(On old server:)
# mysqldump -u zmuser --password=zmpass zm > ./zm_db_backup.sql
(On new server:)
# mysql -u zmuser -p < ./zm_db_backup.sql
# zmupdate.pl
As for copying over events, it should be possible, you just need to make sure the events are in the same format (short, medium, long) that the new storage is set for, and in the same location on the file directory. Then run zmaudit.pl and see if it starts deleting old events. If you make a mistake, you can delete the db, restore the db, and try again. So it's not hard, but there may be some troubleshooting involved.

It will be easier to do this with two separate servers.

See also:
viewtopic.php?f=38&t=27899&p=108791
viewtopic.php?f=36&t=26631&p=102872
viewtopic.php?f=34&t=24405&p=93193
viewtopic.php?f=36&t=26631&p=102872

Basically, if zmaudit looks for the events on the new server and finds them, it will not delete them from the db.

Re: Migrate Zoneminder to new server

Posted: Thu Jun 27, 2019 9:11 am
by ckilner
Thanks!