Updating unifi to debian bullseye

With version 7.5 unifi finally supports openjdk17 which means it is about time to update the vm to bullseye. Of course the mongodb dependency is still horribily outdated. Luckily old mongodb  debs for buster are still available at https://www.mongodb.com/download-center/community/releases

The unifi deb required < 5.0. 4.4 reported that it is too new for the database and 4.2 failed to migrate the database so I had to start again.

  • Download a backup of the config before upgrading.
  • After the upgrade wipe /var/lib/unifi/db
  • Create a dummy account like described here: https://gist.github.com/AmazingTurtle/e8a68a0cbe501bae15343aacbf42a1d8
  • Login and restore the backup.