How to migrate your existing Self-Hosted UniFi Network Cloud Server Legacy Version to the New UniFi Server OS Cloud Linux Solution easily?
There are actually a few ways to perform this migration but let me show you the easiest and fastest way.
This tutorial will explain how to do this migration on the ‘same server’, avoiding the need to pay for another server or changing any DNS entries.
Everything will adopt automatically with no need to change set-inform/ssh per device and avoid the pain of doing a site by site migration which takes a long time.
Make sure your system is up to spec. The minimum recommended is x86/64 CPU (Ideally 2 Core), 2Gb Ram, 100Mbps Internet and 20Gb Storage.
If you are unsure about this and are refreshing your VM from say Ionos or Digital Ocean for example, then go with 4 vCores/4-8Gb Ram/40+Gb SSD which should give you at least 50 sites of SME size at minimum.
Here is the process summary:
- Step 1: Backup properly and have a restore method in case of failure. (We are not responsible for any data loss)
- Step 2: Note down the legacy OS version, UniFi Network Version, UniFi UI.com Account Details & Server SSH Credentials.
- Step 3: Export Full Network Settings Backup (.unf) from legacy web interface.
- Step 4: Wipe Server and Install Ubunutu 24.04 LTS.
- Step 5: Check any Hardware Firewall Rules are Correct.
- Step 6: Run Updates and Run UniFi OS Server installer.
- Step 7: Login to the new https://myowndomain.com:11443
- Step 8: Complete Wizard by NOT choosing the restore from Backup and selecting to use your existing UI.com login details.
- Step 9: Initiate a Network Server application and let it install.
- Step 10: In the new 11443:/network – Settings/System/Backups – Choose ‘Restore’ from the backup file.
- Step 11: All Sites, Devices and Clients will automatically adopt into the new server within a few minutes.
- Step 12: Once everything has settled down, run all Control Plane updates, Device updates and take a new Backup.
Below are the detailed steps:
Step 1 , 2 and 3:
- Ideally make a working Image/Snapshot of your existing server, so that you can restore it fully if anything goes wrong.
- Log into your legacy UniFi Network Server and go to Settings/System/Backup. Choose to download a ‘Settings’ only server wide backup (don’t skip this step) and maybe a ‘7 Day’ backup if you want a bit of historical data included as a second backup. I have found busy servers don’t seem to ever complete backups that are longer like 30 days.
- Optionally (not recommended as you won’t need it for this same server method) but for extra safety or if plan to use a different method of migration then you can painfully export each ‘Site’ in the web interface by going to Settings/System/Site Management and clicking ‘Export Site’. Note that once the file downloads, do not proceed with the wizard unless you are doing an old server to another different server migration – just close it and go to the next site.
- Note down the legacy OS version, UniFi Network Version, UniFi UI.com Account Details & Server SSH Credentials.
Step 4:
- Do a full fresh new install of Ubunutu 24.04 LTS – You won’t need any desktop access, merely SSH server access. (You can try to avoid this by stopping and removing all legacy software first but this really is a good time to update OS versions and start with a clean slate.)
- Make sure you set your root password to something strong. (passwd)
Step 5:
- Adjust all hardware firewall rules to match the following: https://help.ui.com/hc/en-us/articles/218506997-Required-Ports-Reference
11443 TCP UniFi OS Server Web UI (GUI/API)
8080 TCP Device Inform. This is the primary port devices use to "phone home" to the server.
3478 UDP STUN. Used for NAT traversal to help devices find the server.
10001 UDP Device Discovery. Used to "find" devices on L3 networks for adoption.
1900 UDP L2 Discovery
443 TCP Remote Access. For connecting your server to unifi.ui.com and for secure WebSockets.
8880 TCP Guest Portal (HTTP)
8881 TCP Guest Portal (HTTP)
8882 TCP Guest Portal (HTTP)
8843 TCP Guest Portal (HTTPS)
8444 TCP Secure Guest Portal (HTTPS)
6789 TCP UniFi Mobile App Speed Test
Lock Down Port
22 TCP SSH - Locked to your admin IP. Don't expose this to the world.
Optional
5514 UDP Remote Syslog Capture
27117 TCP Local Database Comms
Make sure you get your TCP and UDP settings correct and check the reference article for any additional ports you may require.
Step 6 and 7:
- Lets updates and dependencies.
sudo apt-get update && sudo apt-get install podman slirp4netns
(reboot if required)
- Now install the new UniFi OS Server for Linux on your new Ubuntu server.
- Visit : https://ui.com/download and copy the latest ‘Download’ blue link for ‘UniFi OS Server 4.3.6 for Linux (x64)’
- Now run the ‘Curl’ command below but replace the https://…..//…..6-x64 with your most recent link you just copied.
curl -O https://fw-download.ubnt.com/data/unifi-os-server/2f3a-linux-x64-4.3.6-be3b4ae0-6bcd-435d-b893-e93da668b9d0.6-x64
- Now we need to make the file executable and once again change the example below to match the file name from your download.
chmod +x 2f3a-linux-x64-4.3.6-be3b4ae0-6bcd-435d-b893-e93da668b9d0.6-x64
- Lets get it installing but make sure you modify the line below to once again match your version. Note it starts with a ./ and ends in ‘install’.
./2f3a-linux-x64-4.3.6-be3b4ae0-6bcd-435d-b893-e93da668b9d0.6-x64 install
- Now open the setup wizard web page after giving it a few minutes to install. The link will be something like : https://myowncustomunifiserver.com:11443/setup
Step 8 and 9:
- DON’T choose to restore from backup at this point!
- Sign into your UI.com cloud account and it should also ask for your 2FA details.
- DON’T choose to restore from backup here either! (Choose Continue Without Backup)
- Complete the wizard and choose to launch a ‘Network’ application.
- Now you should be able to access your new UniFi OS Server with no sites installed.
https://myowncustomunifiserver.com:11443/network
Step 10 and 11:
- In the web interface you need to go to Settings/System/Backups – Choose ‘Restore’ from the backup file and select the single server wide .unf file from the legacy server and let it install. This may take 4 to 8 minutes and will auto restart the server. Be patient.
Step 12:
- After a few minutes, check if all your sites devices and clients are now logging in. They should be otherwise check your steps.
- Once all of them have re-appeared, do any devices updates but don’t do the ‘control plane’ updates at the same time wait for devices to finish.
- Now take a backup of your settings/system/backups on the new UniFi OS server.
- This new solution also allows for UOS server updates via the web console and not via SSH like the old system.
- All done!
Although your sites are now working on this server, your UniFi ui.com account ‘Site Manager’ will now populate with a lot of additional information.
You will also have access to ‘Site Magic’ – Site to Site VPN auto connect!
https://unifi.ui.com/ (All sites visible)
https://unifi.ui.com/sd-wan/hub-spoke/new (This is where you set a Hub & Spoke / Mesh – Site Magic)
https://unifi.ui.com/update-manager/uos
https://unifi.ui.com/update-manager/apps
https://unifi.ui.com/update-manager/devices
https://unifi.ui.com/isp-viewer (Overview of all site performance)
https://unifi.ui.com/update-manager/devices
https://unifi.ui.com/admins-list
Additional note, if you use ‘rclone’ or ‘aws’ or any other additional backup method outside of the standard cloud backup then the path for the auto backups has changed and you should verify this directory actually contains your backups after they have been auto executed.
/home/uosserver/.local/share/containers/storage/volumes/uosserver_var_lib_unifi/_data/backup/autobackup
Some Extra References:
https://help.ui.com/hc/en-us/articles/34210126298775-Self-Hosting-UniFi
https://help.ui.com/hc/en-us/articles/218506997-Required-Ports-Reference
https://community.ui.com/releases
https://help.ui.com/hc/en-us/articles/360008976393-Backups-and-Migration-in-UniFi
https://github.com/MiranoVerhoef/UniFi-OS-Server-SSL-Import (Add Lets Encrypt SSL Certificate to Server)
There is a YT watch?v=kL1kqhVNji8 video that describes setting up UOS server but its not a migration method like this. Also touches on using Cloudflare and using software firewall setup.
To benchmark your server CPU:
apt-get install sysbench
sysbench cpu run
sysbench --threads="$(nproc)" cpu run
If you are an individual or another IT company and this seems too daunting, then give us a call and we can perform this process for you.
