Close

How to clean database after deleted camera or changed name?

Share tips and tricks related to Sighthound Video or your full security setup.

Moderator: Staff

no avatar
hellod
 
Posts: 11
Joined: Wed Dec 02, 2015 1:10 am

How to clean database after deleted camera or changed name?

by hellod » Mon Feb 15, 2016 1:57 pm

I amusing the Mac version. I installed then removed some cameras forgetting to ask SH to also remove video files. I also changed some camera location names. I went into the SH "archive" folder, where I found folders with names same as those previously deleted camera location names. I deleted those folders. Now in SH "search" screen, the Camera dropdown still shows those deleted cameras with Videos not found in the selection window under it.

How do I clean up the SH database so it does not present those as a selection in the Search Camera selection dropdown?

Screen Shot 2016-02-15 at 9.56.37 AM.png
P1428E4Kcam has been renamed but still shows as selection in this dropdown
(200.8 KiB) Downloaded 270 times

User avatar
Semper Vaporo
 
Posts: 331
Joined: Sat Oct 09, 2010 11:51 am

Re: How to clean database after deleted camera or changed na

by Semper Vaporo » Mon Feb 15, 2016 6:47 pm

I had the same problem once. I selected the camera in the camera list to get just those clips listed. Then clicked on the first clip and then held down the keyboard Shift key and clicked on the last clip. This highlighted those two clips and everything in-between. Then I right clicked in the highlighted list and selected the "Permanent" delete option. Took a long time, but it did clean everything up.

Just for completeness here, you can hold down the "Ctrl" key to toggle the selection of individual clips in the list... if you wanted to keep 2 clips out of 20, you could either click 18 of them with the "Ctrl" key down, or click the 1st one, then hold down the "Shift" key and click the last one then hold down the "Ctrl" key and click the two you want to unselect (leaving the other 18 selected).

There may be other ways to clean up the database, but what I said above did work for me... it was just really, really slow getting it done. Massive edits to a database file are inherently slow. The database cannot be read into memory, completely edited and then written back totally updated because it has to remain open to other processes that need access to add or delete information. So the "clean up" requires the database to be opened, edited to remove one entry, then closed for the next process to use it if necessary. All that 'open', 'read', 'edit', 'write', 'close' work takes time.
Semper Vaporo,

no avatar
hellod
 
Posts: 11
Joined: Wed Dec 02, 2015 1:10 am

Re: How to clean database after deleted camera or changed na

by hellod » Tue Feb 16, 2016 1:41 pm

Thanks for the advice! After doing that I still see inactive cameras in the camera dropdown in the search screen. Is there a way to remove those inactive cameras from the SH database?

User avatar
Devin
 
Posts: 719
Joined: Wed Mar 12, 2014 5:48 pm

Re: How to clean database after deleted camera or changed na

by Devin » Wed Feb 17, 2016 9:42 pm

Hi hellod,

You can remove any camera (inactive or active) from the Search View by selecting the camera in the "Camera:" list at the top-left of the page and select Tools > Remove Camera.

Regards,

-Devin

no avatar
hellod
 
Posts: 11
Joined: Wed Dec 02, 2015 1:10 am

Re: How to clean database after deleted camera or changed na

by hellod » Thu Feb 18, 2016 1:29 pm

Thanks but after a few quits and reopens of SH, those inactive cameras disappeared without me doing anything. They did linger there for about two days before going away.

User avatar
Semper Vaporo
 
Posts: 331
Joined: Sat Oct 09, 2010 11:51 am

Re: How to clean database after deleted camera or changed na

by Semper Vaporo » Sun Feb 21, 2016 8:42 am

I think there are two things in your comment that are significant... one is that it was 2 days (48-hours) which is the default length of time to keep all raw videos. This implies that cleaning the database of deleted cameras may occur on the same interval as cleaning the folders of non-rule video.

The other is that you restarted SH. I have noted that folders that are empty do not go away until I terminate SH and restart it. I have seen folders that have been empty for 2 months get deleted only after I restart SH. I don't know if there might be some other trigger for the clean-up routine to run, but it implies to me that it only runs at start-up.
Semper Vaporo,


Return to General Discussion
cron