Export / import monitor configs

Forum for questions and support relating to the 1.30.x releases only.
Post Reply
empty01
Posts: 50
Joined: Tue Mar 28, 2017 1:30 pm

Export / import monitor configs

Post by empty01 » Sat Oct 07, 2017 4:19 pm

Hi
I have zm setup on a server but would like to try it on a smaller and less power-greedy server. Problem is I don't want to have to go through the long process of defining all my monitors all over again. Is there a quick way to export my monitor configs to a file and then import that file on the smaller server? I have a look at zmcamtool.pl but that doesn't seem to work / I can't get it to work / this is not what it was setup to do.
Many thanks
Mark

bbunge
Posts: 2660
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Export / import monitor configs

Post by bbunge » Sat Oct 07, 2017 4:39 pm

Dump or backup the zm database. Then on the new machine drop the zm database and import the saved sql.

empty01
Posts: 50
Joined: Tue Mar 28, 2017 1:30 pm

Re: Export / import monitor configs

Post by empty01 » Sat Oct 07, 2017 4:42 pm

Thanks. Not sure how I should do that (don't know much about mysql). Would that just dump the monitor configs, or all the data (recordings etc)? If the latter i guess that would be a big dump (so to speak).
All best
Mark

empty01
Posts: 50
Joined: Tue Mar 28, 2017 1:30 pm

Re: Export / import monitor configs

Post by empty01 » Sat Oct 07, 2017 4:48 pm

Think I found a way to do this - trying now.

bbunge
Posts: 2660
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Export / import monitor configs

Post by bbunge » Sat Oct 07, 2017 5:46 pm

I install Webmin onmy servers. It has several easy to use utilities including one for sql server. Yes, the event records will be brought over but Zoneminder will clean them out

empty01
Posts: 50
Joined: Tue Mar 28, 2017 1:30 pm

Re: Export / import monitor configs

Post by empty01 » Sun Oct 08, 2017 12:13 pm

Got it to work - thanks for the advice

worm6666
Posts: 1
Joined: Tue Mar 31, 2020 10:19 am

Re: Export / import monitor configs

Post by worm6666 » Tue Mar 31, 2020 10:35 am

Configuration transfer/backup (on Windows host):
- container with -p 222:22 parameter added to default config for SSH access
- if not use cp commands mentioned at the end

Source container:

- stop zM -> with button on web interface upper right
- bash into container
docker exec -ti Zoneminder bash
- dump out database "zm"
mysqldump --databases zm > zm.sql
- run ssh for WinSCP to transfer out the file
service ssh start
- copy out the file zm.sql with WinSCP

Destination container:

- stop zM -> with button on web interface upper right
- bash into container
docker exec -ti Zoneminder bash
- run ssh for WinSCP to transfer in the file
service ssh start
- copy in the file zm.sql with WinSCP
- jump into mysql
mysql
- drop database zm
mysql> drop database zm;
- create new blank database zm
mysql> create database zm;
- select database zm to use
mysql> use zm;
- import source zm dump
mysql [zm]> source zm.sql;
- start zM -> with button on web interface upper right

Remarks for mysql:

- list all databases
mysql> show databases;
- in bash without call mysql first
mysqlshow

Remarks for copy files out from and in to container without WinSCP:
- for example Linux hosts:

Copy zm.sql out from linux docker container:
docker cp Zoneminder:/zm.sql .
Copy zm.sql in to linux docker container:
docker cp ./zm.sql Zoneminder:/

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests