Docker upgrade
Docker upgrade
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!
Thanks!
Re: Docker upgrade
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:
In ZM, if you have the db, you have the configuration. You may lose events, however.
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
Re: Docker upgrade
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
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
```
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
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.
If you are updating the docker itself, you will have to remove it and re-install the docker.
Re: Docker upgrade
So for a noob like me, how would the upgrade process be if I consider upgrading your docker?
//Best regards...
//Best regards...
Re: Docker upgrade
If you want to upgrade ZM ,then restart the Docker container.
Re: Docker upgrade
You mean by doing:
and
Code: Select all
docker rm Zoneminder
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
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
Great.. Just needed to be sure... Did a restart but it did not pull the newest container...
Thanks.
Thanks.
Who is online
Users browsing this forum: No registered users and 1 guest