[SOLVED] Move ZoneMinder to a new system

Forum for questions and support relating to the 1.24.x releases only.
Locked
redxiii
Posts: 48
Joined: Thu Aug 05, 2010 1:47 am

[SOLVED] Move ZoneMinder to a new system

Post by redxiii »

edit: Solved. check this post for commands i used.
---
Hi, i want to move ZM to a new system. I've already installed ZM on the new system, and can access the web interface. I want to transfer all of the events, and camera configurations as well. Both systems are 1.24.2 on Ubuntu 10.04.1 64-bits. I found one thread that said I can backup the database using this command:

Code: Select all

mysqldump zm Config Filters Groups States Users Monitors Zones --add-drop-table > /root/zm-config.sql
Once i've done that and have the zm-config.sql file, how do I import that into the new system?

And then, how do i copy over all of the camera configurations and events?

Thanks
Last edited by redxiii on Thu Mar 24, 2011 7:48 pm, edited 4 times in total.
jani
Posts: 11
Joined: Sun Jan 16, 2011 8:49 pm

Post by jani »

mysql -uuser -ppass zm < /root/zm-config.sql should do what you want.
redxiii
Posts: 48
Joined: Thu Aug 05, 2010 1:47 am

Post by redxiii »

thanks.

what about all of the events?
redxiii
Posts: 48
Joined: Thu Aug 05, 2010 1:47 am

Post by redxiii »

i tried using this command, to basically copy /var/cache/zoneminder but, on the new system, in the web interface, it is still showing 0 events for all the camers.

Code: Select all

rsync -r -t -p -o -g -v --progress --delete user@oldSystem:/var/cache/zoneminder/* /var/cache/zoneminder/
but, perhaps that didn't work completely... because the old system has 7.0G in that directory but on the new system it is only reporting 1.6G so a lot didn't get transferred.......

after running the command again, it seems to have transferred everything else... guess there was a hiccup or something. but, still nothing in the web interface.......
redxiii
Posts: 48
Joined: Thu Aug 05, 2010 1:47 am

Post by redxiii »

i tried a similar command to sync /usr/share/zoneminder:

Code: Select all

rsync -r -t -p -o -g -v --progress --delete user@oldSystem:/usr/share/zoneminder/* /usr/share/zoneminder/
without any luck.

the new system is showing some events (presumably from when ZM was running there and capturing events) but they will not play, probably corrupted or something because of the way i've transferred these files over.

how to sync up the events in the web interface?? thanks
redxiii
Posts: 48
Joined: Thu Aug 05, 2010 1:47 am

Post by redxiii »

aha! i think i've got it. just took some more persistent searching: move events, moving events, transferring events, transfer events. something finally turned up.
the problem was with the initial mysqldump command.
instead, i used this command:

Code: Select all

root@oldSystem# mysqldump -p zm > /root/zm-dbbackup.sql
and then restored with

Code: Select all

root@newSystem# mysql -p zm < /root/zm-dbbackup.sql
then transferred/synced the events

Code: Select all

root@newSystem# rsync -r -t -p -o -g -v --progress --delete user@oldSystem:/var/cache/zoneminder/* /var/cache/zoneminder/
finally, i ran

Code: Select all

root@newSystem# zmaudit.pl
now all of the events are showing up in the web interface, and i can view them, and new events are properly being recorded. awesome!
Locked