Can a camera ID be un deleted?

Support and queries relating to all previous versions of ZoneMinder
Locked
jniffen
Posts: 8
Joined: Tue Jul 22, 2008 2:52 pm

Can a camera ID be un deleted?

Post by jniffen »

I am wondering is there a way to recover, undelete or how ever it's phrased the Monitor ID on the ZM console..

We will be installing a second 16 input card from BlueCherry and the ID numbers jump from 16 to 19. I know, I know it's not important but it will be asked by my supervisor.

Also, I know I deleted the IDs myself working on an issue which was realized as too many sub-directories in a directory.

Thanks for any input.
kylejohnson
Posts: 260
Joined: Tue Aug 21, 2007 1:42 pm
Location: Baltimore, MD

Post by kylejohnson »

If you look at the Monitors table in your ZoneMinder database, the first field is "ID" and it is set to auto increment. So, if you delete a row (#16) from that table, and then add a new one, the new ID will be #17, since it is auto incrementing from the last value (even though it has been deleted).

To fix this, you could manually remove the auto increment value on the field, insert the correct number, and then turn auto increment back on.

I have never actually done this, but have had similar issues with programs that use MySQL as a backend... So, there may be other implications that arise.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Adjust MySQL auto increment. Be carefull with this.

Post by zoneminder »

There is no trivial way to do it. The safest way would be to delete the monitors you want to move, do an 'alter table Monitors set auto_increment = xx' via mysql and then recreate them.

In 1.24.x the monitor ids are no longer displayed on the console so it would be less apparent.
Phil
Locked