-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the recommended upgrade procedure? #179
Comments
Docker containers are meant to be disposable, if you update one and then it goes away and you re-run the old one, your internal settings will be fore the new version, but your software will be old. I've been using the same database and config through all the versions of the image, so I honestly don't understand the issues others have been having. :/ |
I'm not sure I follow you. How would it just "go away"? I agree with you that they are disposable, and the usual procedure is to delete one and then run the new version. But my side question was: Why can't I keep one container (and not make it "go away") and simply upgrade the firmware inside the container... Why isn't that working. But, more importantly, can you tell me what procedure you are using to upgrade to a new version of the container once it is release.. while keeping your old camera settings and recordings. Maybe a bullet point list would help me very much. Thanks |
I think this question is not specific on this image but it's about Dockers basics. By using bind mounts (as in the example for If the parameters are set properly, the data will be save, when the container is destroyed. And the new container will find the data and use them. If this doesn't work with your setup, it would be useful if you post your complete run command with all parameters. |
Yeah, you need to be saving your config data outside the container which is what the example Show us your |
Well, just to clarify, I've been using this image for the past 3,5 years on my Synogy NAS and it worked relatively well (including preserving videos and configuration) up until (I suppose?) version 3.10.X. Up until then, I was using 2 mounted drives, one for my data and another one for the videos. To quote the documentation: "Starting with Unifi Video 3.10.x, in-place upgrades are not fully supported. It's best to generate and save a backup file, and remove your data folder. Then restore the backup from the web setup page." From then on, it hasn't been smooth for me. At all. Including exporting the config (which is a pain because I would sometimes forget to do the export before deleting the container...) and then trying to restore it in the new image. Here is my CURRENT docker run command:
The way I USED to do it was with this command (preserving my settings): |
Your current
^ This is mine, of note is that the config/db inside at |
Thanks for your response. I USED to preserve the config... but a while ago I started having issues (don't remember what they were) so I went back to the documentation and this is when I saw the paragraph I quoted. The author specifically stated that I needed to EXPORT the config and IMPORT it again... Now, thinking about it again, perhaps he meant that I only need to do this procedure ONCE (to go from 3.9 to 3.10)?!? I understood from that text that I needed to export and import my config EACH TIME a new image is available. that was a pain. Now, with your comments.. I'm thinking that I can go back to how I was doing things (2 mounted drives preserving config and recordings). That would certainly be good news. I'll try it tomorrow. As for the -ti, if I remember correctly, I think that it is because I run the contained from a SSH shell, and then I need to close that shell. If I don't use those commands, the shell needs to remain connected. Thanks for helping me on this. Hopefully that settles it. |
Yeah, I think that was for the 3.9 -> 3.10 transition where they went from whatever the old mongodb format was to the new wired tiger format. Why are you running it from a shell at all? I'm weird and like systemd
But obviously, you'd need to tune that to your own setup. |
Mostly because I didn't know any better. I would SSH to my NAS and from there I would create and delete containers. Also, because it isn't running "standard linux" but Synology's DSM (their OS, based from Linux), I have been wary of changing things in system directories that can eventually get modified during an update. I've had bad experiences when I "reinforced" my openVPN (trying to harned the basic settings that comes in the Synology package). My custom settings would get deleted. Are you also running your container on a Synology NAS? PS: I can't believe this whole time I though I needed to export/import the config. Perhaps the readme note should be clarified. I'm probably not the only one who got confused. Thanks. |
Oh, I see you're using Synology. Anything you do via CLI should get reflected in their GUI, you shouldn't need the https://old.reddit.com/r/usenet/wiki/docker#wiki_get_docker_run_command I just run this on my Arch Linux server, not Synology. :( |
I think running containers as a service isn't usual (anymore?). Configured as a service Docker will take care that the containers are running, if you use a restart policy and @dolphinkite has already If this is not cool enough, you can use @dolphinkite I also start my containers from the shell and simply use |
@thoschworks: Yeah, running containers from a systemd I would totally not recommend it for most, |
Hi, Thanks all for the input. A few comments and answers to the various questions:
Can you explain the advantage of those options?
When I first started dabbling with Docker, over 4 years ago, the Synology GUI was very immature. Since this was new to me, I read a lot and it became clear that in my setup I needed to use the option
Again, it goes back 4 years ago. If I remember correctly, those options allowed me to "connect to the container" later and do things like edit files. For example, rereading my own documentation that I wrote while building those docker files, at some point (when I first created the container? I don't even remember) I needed to edit one of the files from within the container. The code in my notes is the following: Thanks all for your input. |
TLDR: What is the recommended upgrade procedure?
Bonjour Philippe,
I've been using this docker container for many years now (inside a Synology NAS), but recently, I've been unable to upgrade to the latest version without completely redoing the configuration from scratch.
I did view your comment: "starting with Unifi Video 3.10.x, in-place upgrades are not fully supported. It's best to generate and save a backup file, and remove your data folder. Then restore the backup from the web setup page." but can you share more information on how to achieve this?
I used to map 2 folders, one for my data (-v /volume1/docker/unifi-video/data:/var/lib/unifi-video) and another one for my recordings (-v /volume1/docker/unifi-video/recordings:/var/lib/unifi-video/videos). Before 3.10, I would simply delete the container, create a new one and everything would be fine.
Since 3.10 (I assume), it doesn't work. I did try to backup my config (Settings --> Download configuration). Then delete my data folder (/volume1/docker/unifi-video/data) and from now on, only map my recorded videos folder when I run the container.
At the welcome page, I chose restore config and this brings me a working installation of the controller. But my camera cannot connect to the controller. At times, I even can't connect directly to my camera (my old password doesn't work, nor ubnt/ubnt). I do a master reset on the camera, and then manage (sometimes) to have it connect to the controller (tried the adoption token, with mixed results). But when I do, none of the settings (motion detection zone, etc.) are kept and I must configure the camera again. Also, none of my previous recordings are visible (although I can see they are on disk). Even weirder, when I go to System --> System configuration, it states that the recording path is /usr/lib/unifi-video/data/videos but I think it used to be var/lib/unifi-video/videos. Changing the path there doesn't fix the situation - my old recordings are still not visible within the controller.
Can you explain in more details the recommended steps to upgrade the controller?
As a side note, for the past few years, I've been windering why it is impossible to use the update mechanism that is built in unifi-video? I've tried it many times (as others I'm sure) when I got a message that a new version of Unifi Video is available inside the controller, but it inevitaly fails, I'm sure there is a logical explanation but I don't understand why..?
Thanks for your help.
The text was updated successfully, but these errors were encountered: