Restoring a deleted monitor

Support and queries relating to all previous versions of ZoneMinder
Locked
phrak9
Posts: 8
Joined: Fri Dec 14, 2007 4:07 pm

Restoring a deleted monitor

Post by phrak9 »

is there a way to change the id of a current monitor to an accidently deleted one?
haus
Posts: 213
Joined: Thu Oct 11, 2007 5:10 am

Post 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. :)
User avatar
MJN
Posts: 262
Joined: Wed Jan 17, 2007 10:29 am
Location: Wiltshire, UK

Post 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
haus
Posts: 213
Joined: Thu Oct 11, 2007 5:10 am

Post 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. :)
phrak9
Posts: 8
Joined: Fri Dec 14, 2007 4:07 pm

Almost there....

Post 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.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post 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.
Phil
Locked