Replacing Unifi switch

Very small setup here.
I have a USW Pro 24 port switch. This is the main switch while there are other PoEs downstream from it.

The 24 port switch hosts my Xenservers which is hosting my Unifi controller. Thinking ahead, one day this switch will need to be replaced. Maybe I need a 48 port or maybe I need to do a hardware replacement.
How do i replace this switch if it has my Xenservers directly connected to it which is hosting my self-hosted Unifi controller? The controller is in a separate VLAN.
Can I rip and replace the switch? If so without knowing about the VLANs, how would it register with the controller?
Just thinking about it, i cant just replace a switch (even of the same model) because there would be no way to get VLANs to it so it knows which links it has trunked to find the controller.
Im used to copying the config and changing some ports configs around on non-controller type gear such as Juniper or Cisco, so im new to how to do this with a controller.

You can just configure the new switch first by connecting it downstream. Make sure it has the same config as the primary switch. Afterward, you can swap it.

1 Like

what if my switch fails? thats the scenario that gives me the most concern.
Selfhostd controller is on a different VLAN. Replaced switch wont have the new VLANs to get to the controller.

This is why I leave the management vlan on 1, and have vlans for other networks

I change the ssh username and password - snmp is not enabled

1 Like

So basically move my controller out of the VLAN and onto the same VLAN as the rest of the Unifi gear?
Makes sense actually…

This is less about network security and more about reliability and robustness.

edit: I still fall into the same problem. The unifi controller is in a VM. The XCP-NG server is trunked to the switch. The switch doesnt know about trunking or vlans. It would need to know about it in order to speak to the controller regardless if its on the same management vlan or not.

Just to make sure im clear i made a diagram.
The Unifi gear is in VLAN 69
Unifi self-hosted controller is in VLAN 3
If the switch fails and i get a new switch, how do i adopt it to the controller if the switch does not know VLANs or Trunking as I did not configure it yet and it cant get a copy of the config from the controller because it wouldnt know that it needs to create a trunk and tag vlans across it.?
Feels like a chicken before the egg scenario.

As long as the new switch can reach the controller on the native VLAN 3 then you can adopt and configure. Otherwise you won’t be able to. Only way around this is to set your native VLAN to 3 or get another switch for redundancy so in the case a switch dies you can plug in a new switch and apply the dead switches config.