jacobalberty / unifi-docker

Unifi Docker files
MIT License
2.17k stars 458 forks source link

What is the happy path to upgrade image version #418

Closed rickyzhang82 closed 2 years ago

rickyzhang82 commented 3 years ago

Host operating system

Fedora

What tag are you using

6.0.45

Question

I'm new to unifi controller and this docker repo. I wonder how to upgrade in the future.

I used 6.0.43 a month ago. I find that I can't upgrade to 6.0.45. I have to run docker-compose down --volume to have a clean slate.

Is that common? Can I do a setting backup to a file and restore in a clean slate? Will I have to adopt all Unifi stuffs again?

TIA

buckaroogeek commented 3 years ago

My docker-compose.yaml file has this reference for the image:


unifi: image: "jacobalberty/unifi:stable-6" . .

When I update, I do a docker-compose pull unifi that grabs the current release. Then that is followed by docker-compose up -d unifi which creates a new container with the new image. It just works for me. Once running I can use docker or docker-compose to remove the old image from the local repository docker maintains.

The volume lines in the compose file retains necessary data. Down time for the controller is just a few minutes.

Brad

On Fri, Mar 5, 2021, 18:08 Ricky Zhang notifications@github.com wrote:

Host operating system

Fedora What tag are you using

6.0.45 Question

I'm new to unifi controller and this docker repo. I wonder how to upgrade in the future.

I used 6.0.43 a month ago. I find that I can't upgrade to 6.0.45. I have to run docker-compose down --volume to have a clean slate.

Is that common? Can I do a setting backup to a file and restore in a clean slate? Will I have to adopt all Unifi stuffs again?

TIA

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jacobalberty/unifi-docker/issues/418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKDYHVMPWDYPICWLVVANJ3TCGFANANCNFSM4YWGSYFQ .

rickyzhang82 commented 3 years ago

I followed your approach, change the tag and restart the controller pods.

But now my U6-LR got stuck in adopting state.

Is it normal? It was connected state prior to that.

Now I have to manual unplug AP cable and force it to restart to bring back the connected state. It is a hassle but works.

buckaroogeek commented 3 years ago

Good morning

It has been a couple of years since I hosted my controller on fedora. Did you by chance use the controller rpm from rpmfusion to install the controller?

To answer your question, you should not need to unplug and reset the AP. I have not needed to do that. Sometimes adoption of an AP or switch can be slow or stall but that is rare. I ssh into the AP or switch and run a set-inform command using the IP of the controller and that will usually resolve the adoption problem.

I wrote a how-to on using fedora as a host for the controller a couple of years ago https://community.ui.com/questions/How-To-Unifi-Controller-and-Podman/c2ca3cbc-3317-4454-995d-41f2156f6d7b but moved the controller to a Synology NAS so have not refreshed post. If I were to host on fedora today I would definitely use the rpmfusion package. For an update with the package I would just wait until the maintainer updates the package and use the normal dnf update process.

Brad

On Sat, Mar 6, 2021 at 5:14 AM Ricky Zhang notifications@github.com wrote:

I followed your approach, change the tag and restart controller pods.

But now my U6-LR got stuck in adopting state.

Is it normal? It was connected prior to that

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jacobalberty/unifi-docker/issues/418#issuecomment-791936637, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKDYHWQUP3RQTLDH2TCFH3TCITCJANCNFSM4YWGSYFQ .

rickyzhang82 commented 3 years ago

Morning!

I got my WiFi 6 AP U6-LR yesterday after a month waiting. During the wait last month, I tried different version unifi controller. Now I run the unifi controller in Fedora Dell T20 home server as pods orchestrated by docker-compose which wraps into a systemctl service. The problem I found is that the volume in older version 6.0.43 is incompatible with the newer version 6.0.45. I have to clean up the volume of 6.0.43 by using docker-compose down --volume to use 6.0.45.

Using the tag stable-6 doesn't address the upgrade compatibility problem. It is a moving target. Now the image tag stable-6 points to tag 6.0.45.

I wonder:

  1. If I keep the controller version unchanged, can I upgrade the latest AP firmware?
  2. If I backup the settings of controller form version A, can I restore the unifi network to version B in another unifi controller? (I have done that in pfSense router. It works pretty well)
  3. If upgrade is broken very often, what's the alternative? I found RPI can run unifi. Does a dedicated cheap ARM board offer smooth upgrade? Do I have to buy their $200 unifi cloud key? My goal is to have a cost-effective and smooth upgrade in future.

PS: Fedora upgrades once a year. The dependency like JDK and mongo DB may break. To be honest, even RPM from Fedora upstream may break from time to time. So I doubt the reliability of RPM from fusion.

I will try ssh into AP and trigger set-inform next time.

buckaroogeek commented 3 years ago

I am puzzled by the problems you are experiencing. As a reference point I migrated from a v5.x version to v6 around the 6.0.28 (if I recall correctly) and have been doing the usual docker-compose pull, docker-compose up -d sequence without problems. But then I am currently using docker on a Synology NAS as the host. I would not expect to see breaking changes in volumes in the 6.0.x series of updates. A breaking change should trigger a 6.1 point release at a minimum in my opinion.

In any case to answer your questions:

  1. Yes. You will be able to update the firmware without updating the controller. Until, that is, Ubiquiti decides differently. At some point the 6.0.x series will become unsupported.
  2. In theory yes. Chris Sherwood talks about the process he used at https://www.youtube.com/watch?v=oUJPhLBFXAw - although this is 2 years old.
  3. My experience has largely been trouble free with controller updates in the same version (i.e. 6.0.x). I did have serious problems with a 5.x to 6.0x change early in the 6.0 series so I reinstalled 5.x and restored the settings from a backup I always during before any version update.

I use Fedora on my main workstation and have since version 1. :) One of the benefits of using Jacob's container version of the controller is that you are largely isolated from host updates such as with Java or mongo.

I have a (mostly) current version of my docker-compose file that includes my unifi controller and other docker services at https://github.com/buckaroogeek/unifi-pihole-doh-docker. You will see I use a macvlan which creates a unique IP for the unifi controller on my local area network and allows the controller to directly use ports 80/443. But other than that it might be helpful to compare with the compose file you are using. The rpmcache service is a work in progress so please ignore that!

best wishes

brad

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.