Page 1 of 1

Docker upgrade

Posted: Thu Feb 06, 2020 4:29 pm
by EK701
I’m currently running the 1.32.4 dlandon docker image. What is the proper way to upgrade to the 1.34 docker image without losing my existing configuration and database?

Thanks!

Re: Docker upgrade

Posted: Fri Feb 07, 2020 5:23 am
by snake
I can't speak for docker w/zm (hopefully someone else will chime in) but you can always backup the db and then go back / restore should something go wrong.

For docker, a quick search online comes up with this command for backing up a mysql db:

Code: Select all

# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql

# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
In ZM, if you have the db, you have the configuration. You may lose events, however.

Re: Docker upgrade

Posted: Tue Feb 11, 2020 10:47 pm
by EK701
Just a follow up that I upgraded my zoneminder docker installation using the typical docker upgrade path (docker stop, rm, run a new instance) without any issues.

Re: Docker upgrade

Posted: Wed Feb 26, 2020 7:22 pm
by warcanoid
If I can ask here. I have mounted a second internal drive to ZM. Added disk to fstab in host and docker. But on system reboot docker wont auto mount disk(only host do it). How can I make auto mount disk persistent in docker?

EDIT: Have reinstalled Zoneminder with `v "/media/zm":"/mnt/ZM`, and working with path /mnt/ZM
```
sudo docker run -d --name="Zoneminder" --net="bridge" --privileged="true" -p 888:80/tcp -p 9001:9001/tcp -e TZ="Europe/Berlin" -e SHMEM="50%" -e PUID="99" -e PGID="100" -e INSTALL_HOOK="1" -e INSTALL_FACE="1" -e INSTALL_TINY_YOLO="1" -e INSTALL_YOLO="1" -v "/mnt/Zoneminder":"/config":rw -v "/mnt/Zoneminder/data":"/var/cache/zoneminder":rw -v "/media/zm":"/mnt/ZM":rw dlandon/zoneminder
```

Re: Docker upgrade

Posted: Sat Feb 29, 2020 7:18 pm
by dlandon
All you have to do is restart the docker and ZM wll be updated. All database files and setup are kept in the /config/ folder. Thus is the nice thing about dockers, your data is not kept in the docker image. You can delete the image and re-install it and your database and settings will be kept.

If you are updating the docker itself, you will have to remove it and re-install the docker.

Re: Docker upgrade

Posted: Fri Dec 04, 2020 1:04 pm
by Minglarn
So for a noob like me, how would the upgrade process be if I consider upgrading your docker?

//Best regards...

Re: Docker upgrade

Posted: Fri Dec 04, 2020 3:27 pm
by Magic919
If you want to upgrade ZM ,then restart the Docker container.

Re: Docker upgrade

Posted: Sun Dec 06, 2020 1:17 pm
by Minglarn
You mean by doing:

Code: Select all

docker rm Zoneminder
and

Code: Select all

docker run -d --name="Zoneminder" \
--net="bridge" \
--privileged="true" \
-p 8443:443/tcp \
-p 9001:9001/tcp \
-e TZ="SE/Stockholm" \
-e SHMEM="50%" \
-e PUID="99" \
-e PGID="100" \
-e INSTALL_HOOK="1" \
-e INSTALL_FACE="1" \
-e INSTALL_TINY_YOLOV3="0 \
-e INSTALL_YOLOV3="0" \
-e INSTALL_TINY_YOLOV4="1" \
-e INSTALL_YOLOV4="" \
-e MULTI_PORT_START="0" \
-e MULTI_PORT_END="0" \
-v "/mnt/Zoneminder":"/config":rw \
-v "/mnt/Zoneminder/data":"/var/cache/zoneminder":rw \
dlandon/zoneminder

Re: Docker upgrade

Posted: Sun Dec 06, 2020 2:32 pm
by Magic919
Yes, a stop, rm, run should do it. For other images I usually run a pull, but above here you can see the author says restart is enough.

Re: Docker upgrade

Posted: Sun Dec 06, 2020 3:31 pm
by Minglarn
Great.. Just needed to be sure... Did a restart but it did not pull the newest container...
Thanks.