Page 1 of 1

Restoring a deleted monitor

Posted: Fri Jan 11, 2008 12:26 am
by phrak9
is there a way to change the id of a current monitor to an accidently deleted one?

Posted: Fri Jan 11, 2008 2:57 pm
by haus
There might be a better way, but I wonder if you could install phpmyadmin, stop ZM, and just edit the monitor ID in the database, then restart ZM.

Just a thought - not guaranteed to work. :)

Posted: Fri Jan 11, 2008 8:48 pm
by MJN
I wondered the very same thing a while back but it seems it's not quite that simple...!

http://www.zoneminder.com/forums/viewtopic.php?t=8576

Do give the suggestion a try though, and tell us whether it works or not! ;)

Mathew

Posted: Fri Jan 11, 2008 10:16 pm
by haus
Good find. I figured there was more to it than just the ID in the table. I figured events directories might still exist so maybe they wouldn't have to be re-created or modified, but obviously if you go changing things with archived events (or even just non-deleted events) things will point to the wrong place if you to changing table values.

Last time I had to do this, I just reinstalled ZM. It was easier since I had 11 monitors with numbers all over the place. :)

Almost there....

Posted: Mon Jan 14, 2008 3:41 pm
by phrak9
I tracked down instances of MonitorId
Shut down zoneminder
Backed up DB
Ran UPDATE statements to change the monitor ID's
Renamed the monitor number and re-linked dir's in events dir
Restarted ZM and watched zmaudit.pl blow away events not connected
to the new Monitor number.

Any suggestion to change the association of the events so zmaudit dosent destroy the recorded events in the DB would be great.

Posted: Mon Jan 14, 2008 11:21 pm
by zoneminder
If you just change the MonitorId in the Events table that will change the association in the DB. You will need to make sure that the files are relocated to the correct path under the events directory as well. Those two things should be enough but I always recommend keeping a backup just in case or trying with a couple of test events before doing the rest.