Restoring Unifi Controller

Today I woke up and realized that a power surge a while back had taken down our Unifi controller without me realizing. I went to log in to check on firmware updates for the network only to see that I couldn’t log in at all. I guess that’s the benefit of hosting your controller via a CloudKey Gen 2 with a built-in on-device battery vs. on a Raspberry Pi like I do.

That said, restoring from scratch was actually super easy, given that I had regular backups. Here’s the process and some additional reading that I used.

Assumptions

Note: If you don’t have all of this set up already, and are instead looking for a primer on getting it set up from scratch, follow the link in the Further Reading section below on How to Host Unifi Controller on Raspberry Pi

Steps

  1. Uninstall the Unifi controller: sudo dpkg -P unifi
    • Note that in this article here it recommends that you fully delete the /usr/lib/unifi/data directory. I did NOT do this and was totally fine
  2. Update your package references: sudo apt-get update
  3. Install the most recent Unifi distribution: sudo apt install unifi
  4. Wait for the installation and the bootstrapping of the webserver
  5. Navigate to your static IP for the controller, specifically to port 8443
    • You’ll need to accept the self-signed certificate
  6. Click through the wizard to find the “Restore from Backup” button
    • Should be pretty early on in the process, if not on the very first screen
  7. Upload the backup
  8. Wait for the restoration to finalize
    • The page will reload for you automatically and forward you to the login screen that should be familiar
  9. When you log in, you’ll notice all of your Unifi devices will start adopting
  10. Waiting for the adoption process to finalize. Note: Your APs will likely stop broadcasting the network momentarily while this adoption process will occur
    • My network was unavailable for like 30secs.
  11. You’re done!

While the above seems like a lot of steps, it was actually super straightforward and just involved some waiting.

Further Reading

References