"Forget" your access point(s) on your existing UniFi Controller before adopting it on your hosted controller

Automated Script for UniFi Controller Upgrade on Linux/Unix Systems


After writing the post on how to quickly upgrade your Ubiquiti UniFi Controller on non-Debian Linux boxes (I run mine on CentOS), I decided that it still wasn’t quick enough. So I threw together a script called upgrade_unifi.sh that does the following:

  • Stops the existing UniFi Controller
  • Makes a backup of your old UniFi Controller directory
  • Downloads and extracts the updated UniFi Controller (or any version, actually) from UBNT’s download site
  • Copies your settings and historical data over from the old UniFi Controller
  • Restarts the new version of the UniFi Controller

When run from the command line, the script allows you to upgrade to a new version of UniFi controller in less than 60 seconds.

The script’s default settings will work in most cases, but they also give you a lot of flexibility. The script assumes you already have a version of UniFi Controller running on your system, that the UniFi Controller directory is owned by a user named ubnt (though that’s easily changed in the options), and that you’re running a startup script that obeys the service UniFi start and service UniFi stop commands (I’ve written UniFi startup scripts for SysV and systemd systems here).

Feel free to download or clone the script and try it on your Linux system. Suggestions for improvements are always welcome!