UniFi - How can I restore a backup configuration?

There are two ways to restore the backup. The preferred method is with the .unf file generated by backup settings. Alternatively if you have a copy of the /data directory that will allow recovery too.

If you have the .unf (backup) file you can either restore from an active controller (Settings>Admin>Restore) or from the first page of the setup wizard (Browse near the bottom).

--

If you have the original /data folder (all subfolders and contents inclusive), you can

  • stop the controller
  • make sure java and mongod are not running (on Windows mongod is rather persistent, so it's best to perform the following steps in Safe Mode)
  • copy the new keystore (found in new /data directory) file to the old backup /data directory, overwriting the old one
  • delete the new data directory
  • copy the old /data directory to the new UniFi installation
  • restart the controller

--Data folder locations

MSW:
Vista+: C:\Users\username\Ubiquiti UniFi\data
XP: C:\Documents and Settings\username\Ubiquiti UniFi\data

Linux: 
Actual directory: /var/lib/unifi/
Symlinked directory: /usr/lib/unifi/data

Mac: /Applications/UniFi.app/Contents/Resources/data

--

If the .unf file is really large it may give you an error saying Failed to Start on import or migration. If you have time you can let this sit for a while, and then try accessing the controller. It may import fine. If it doesn't you may need to revert to the original version of the controller, run the pruning script, make a new backup, then either purge and install then restore, or do an in-place upgrade.

We are reviewing database management to alleviate or eliminate this issue. This article will be updated later to reflect that.