pducharme / UniFi-Video-Controller

Docker for Unifi-Video Controller (Ubiquiti Networks)
199 stars 105 forks source link

Update to 3.10.1 #124

Closed ordinarygulp closed 5 years ago

ordinarygulp commented 5 years ago

https://community.ubnt.com/t5/UniFi-Video-Blog/UniFi-Video-3-10-0-Soft-Release/ba-p/2656471

ordinarygulp commented 5 years ago

3.10.1 release added: https://community.ubnt.com/t5/UniFi-Video-Blog/UniFi-Video-3-10-1-Soft-Release/ba-p/2658279

depasseg commented 5 years ago

How does this handle the (what appears to be) a complicated upgrade process (in the traditional installation) from 3.9.12? Has an upgrade been tested?

ordinarygulp commented 5 years ago

@depasseg reading the release notes, it is not that intricate. They suggest existing installations use their built-in upgrader instead of dpkg: wget https://dl.ubnt.com/firmwares/unifi-video/v3.10.1/unifi-video.Debian7_amd64.v3.10.1.deb; /usr/lib/unifi-video/bin/ubnt.updater unifi-video.Debian7_amd64.v3.10.1.deb

Let me see what I can come up with.

ordinarygulp commented 5 years ago

Working from restore, but I couldn't upgrade directly.

Working build here: https://hub.docker.com/r/d2dyno/unifi-video

seaside1 commented 5 years ago

Tried out d2dyno. Al.so restored from backup. Takes some time to flash the cameras with new firmware as well. But seems to work

fryfrog commented 5 years ago

I'm going to take your changes and shove them into beta and master, but for 3.10.1.

Thanks!

fryfrog commented 5 years ago

My MongoDB is looping restart: https://ptpb.pw/WJPO

I think maybe the db needs to update to 3.6 to use 4.0?

fryfrog commented 5 years ago

I've pinned master to 3.6. In my own fryfrog/unifi-video-controller:beta, I'm working on making the run.sh script upgrade the db feature as it can. But you have to step through each version, so someone going from say 3.4 -> 4.0 is fucked, but 3.4 -> 3.6 -> 4.0 works.

I'm not sure how to make a graceful way of doing that. My thought is to do two things... set the current to 3.6 for awhile, months or more maybe. Then set it to 4.0. That way, everyone who updates in a reasonable time frame will be fine. For the others, make sure there is a :tag step that can be done manually, ie run w/ :3.10.1-mongodb3.4, then 3.10.1-mongodb3.6 and finally just :latest or whatever.

fryfrog commented 5 years ago

I just made it to mongodb 4.0 via stepping from 3.4 (original install) to 3.6 and then to 4.0. It works, so yay.

ordinarygulp commented 5 years ago

I will have to read more about docker, but I'm very familiar with shell scripts. It shouldn't be too hard to have checks run to see which mongo version someone has, and automatically step them up to 4.0.

I just need to read some docker docu to see if I need to invoke container restarts or what else is needed.

fryfrog commented 5 years ago

They're already there, check out my repo's beta branch.

The complication is just that you can only upgrade the feature level of a db by a version or two. For example, many users are probably on 3.2 because that is some old as shit unifi-video db. You can run that w/ 3.4. You can upgrade it to 3.4 from 3.4. Then you can run that on 3.6 and upgrade it to 3.6. And on that one, you can run it on 4.0 and upgrade it to 4.0.

So it isn't as simple as running a command on the db file, the db has to be loaded and running in a working version of the server. A slightly newer, working version of the server. So we'll need to build a 3.4 image for those w/ 3.2 that auto upgrades the db to 3.4 features. Then they can run that on a 3.6 image that auto upgardes to 3.6. Then they can run that on one that runs 4.0 and auto upgrades it to 4.0.

That is all setup in by beta, I just don't have labels for it.