info_i_25x25.png Due to unforeseen weather conditions we are experiencing higher chat wait times. Remember you can also submit a ticket and one of our support representatives will get back to you as soon as possible. We apologize for the inconvenience.

UniFi - How to Create and Restore a Backup


Overview


This article describes how to generate a backup of the UniFi Controller as well as how to restore it. This article does not cover the Auto Backup feature. You may see this article for more information on that subject: UniFi - How to Configure Auto Backup.

NOTES & REQUIREMENTS:
This article is applicable to current UniFi Controller versions. Instructions on backups for older versions can be found at the end of this article. As always, we suggest you update to the newest UniFi Controller software available.

Table of Contents


  1. Introduction
  2. Generating a New Backup
  3. Restoring a Backup
  4. Related Articles

Introduction


Back to Top

Creating a UniFi Controller backup is an important practice that could save a network admin a lot of frustration. To ensure a backup is always handy, users should enable the Auto Backup feature. When generating a backup manually, a user can select to save only Controller Settings, which would include the config.properties and system.properties configuration files, maps, and any customized files in a site's hotspot portal folder; or include historical data as well.


Generating a New Backup


Back to Top

Users can generate a new UniFi backup file (.unf) at any moment by going to Settings > Maintenance > Backup > Click Download Backup button. You can modify the Data Retention to hold historical data, or to just save your Settings before downloading.

NOTE: The Backup Data Retention should not be confused with the Data Retention section, also under the Maintenance  tab that allows users to determine the retention of information of the different time series shown in the Insights and Statistics sections of the Controller.

Screen_Shot_2018-04-04_at_4.01.14_PM.png


Restoring a Backup


Back to Top

Method 1: Restoring in the UniFi Controller

To restore a backup you have previously downloaded, log in to the UniFi Controller and follow these steps:

1. Go to Settings > Maintenance > Restore > Click Choose File button.

2. The file will load and you will be asked to confirm you wish to restore that backup.

Screen_Shot_2018-04-04_at_4.07.48_PM.png

3. Once you confirm, the backup restoration will begin. This process takes a few minutes, do not disconnect while the Controller is working on this. Once the new backup is restored, the Controller will restart.

Method 2: Restoring in the UniFi Startup Wizard

If beginning a new installation, it will be easier to just use the option of restore from a previous backup as soon as the UniFi Startup Wizard launches, and select your .unf file.

restore_setup.PNG

Method 3: Restoring from the /data Directory

ATTENTION: This method is for older UniFi Controller versions and is not recommended. For security reasons, we suggest to always upgrade to the newest release available. If you still wish to use this method, click on the link below.
Click here to display Method 3: Restoring from the /data Directory.

If the original /data folder (with all subfolders and contents inclusive) is available, follow these steps (some might need to be performed via CLI):

  1. Stop the Controller.
  2. 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)
  3. Copy the new keystore (found in new /data directory) file to the old backup /data directory, overwriting the old one.
  4. Delete the new /data directory.
  5. Copy the old /data directory to the new UniFi installation.
  6. Restart the controller

Data folder locations:

Windows

  • 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
User Tip: If the .unf file is very large it may result in an error saying Failed to Start on import or migration. You may let this sit for a while, and then try accessing the Controller. It may import without a problem. If it doesn't import properly though, 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.

Related Articles


Back to Top

UniFi - How to Configure Auto Backup