2 - Migrate from existing Unifi Controller v4.8.x to new Unifi Controller v5

This is the second of two posts about “how to setup an LXC Container with a Unifi Controller v5 on Ubuntu Server 16.04” and “migrate from an existing Unifi Controller v4.8.x to a new Unifi Controller v5 installation”.

I assume you have read all the involved release notes and changes (e.g. => https://community.ubnt.com/t5/UniFi-Updates-Blog/UniFi-5-2-9-is-released/ba-p/1694199 AND this article http://community.ubnt.com/t5/UniFi-Wireless/upgraded-from-4-8-to-5-now-I-have-no-web-ui/td-p/1580400 )!
And also that you have made a BACKUP of all your data before starting with this tutorial!

I have a different approach on updating/migrating to the new Unifi Controller v5 than described in this article:
http://community.ubnt.com/t5/UniFi-Wireless/upgraded-from-4-8-to-5-now-I-have-no-web-ui/td-p/1580400.
I wanted to have a proper installation on a new LXC Container. Thats why im using LXC Containers. It’s easy to setup a new container and move or restore data from an existing one.

If don’t have much data to move and my history isn’t important. So i decided to use the easiest way to migrate. This should work for the most people using Unifi Controller.

First thing to do is to make sure you are using the latest version of the UC v4, or at least 4.8.20. You find this information in your admin panel under Settings->Maintenance->Version.

We need the Backup to Restore in the new UC v5.

IMPORTANT! *If you have a large Unifi installation (lots of APs and/or lots of data) you may run into a timeout while backuping up from the Web UI! It also depends on your retention setting. If you don’t need historical data, play safe and use “1 week” retention to create the backup. You can also have a timeout problem while restoring the data on the new UC v5. *

There is another possibility to backup/restore. You may read this: https://help.ubnt.com/hc/en-us/articles/204952144-UniFi-How-can-I-restore-a-backup-configuration-

Now weneed to shutdown your old Unifi Controller wherever you have installed and running it!

Shutdown old Unifi Controller Service:

And on the Host shutdown LXC Container, if you use one. (My Host System is an Ubuntu Server 14.04):

lxc-stop -n UnifiController

… and make shure autostart is deactivated on the Host System.

vim /var/lib/lxc/unifiController/config
# Template used to create this container: /usr/share/lxc/templates/lxc-ubuntu 
# Parameters passed to the template: 
# For additional config options, please look at lxc.container.conf(5) 
# Common configuration 
lxc.include = /usr/share/lxc/config/ubuntu.common.conf 
# Container specific configuration 
lxc.rootfs = /var/lib/lxc/unifiController/rootfs 
lxc.mount = /var/lib/lxc/unifiController/fstab 
lxc.utsname = unifiController 
lxc.arch = amd64 # Network configuration 
lxc.network.type = veth 
lxc.network.flags = up 
lxc.network.link = br0 
lxc.network.hwaddr = XX:XX:XX:XX:XX:XX 
lxc.network.ipv4 = 192.168.XXX.XXX/24 
lxc.network.ipv4.gateway = 192.168.XXX.1 
# Autostart 
#lxc.start.auto = 1
#lxc.start.delay = 5
#lxc.start.order = 100

Now open the URL of you new installed UC v5 and click “restore from a previous backup”

Choose your backup file:

Login with your credentials and go to “Devices”. Check if your APs are there and adopted.

In my case the APs started to upgrade the firmware immediately, because i had the “Automatically upgrade firmware” check under Site->Services and after restoring the APs updated all together. Keep this in mind if you update a companies WLAN and this Option is checked. The whole WLAN will then update simultaneous and nobody can access the WLAN till the FW upgrade is finished:

There are also changes to make in the settings.

Go to the Settings->Controller and check the IP of the Unifi Controller. I had to change the IP.

And “maybe” you need also to check “Override inform host with Controller Hostname/IP”. Be carefull with this option if you use domain names/IPs that maybe can’t be resolved/reached by all the AP’s your managing!

(You can also see the current version of the UC v5.)

An optional thing to do is to take a backup of the configuration at this moment. It’s now also possible to only backup the Settings without other data.

Another new possibility is to configure auto backup. I did this also.

After this changes my APs also went online again. Puuh, everything worked fine.

Time to check all the new Features of the UI. It’s a great update in my opinion. Well done ubiquiti.

Link to the manual Unifi Controller V5: https://dl.ubnt.com/guides/UniFi/UniFi_Controller_V5_UG.pdf