A switch swap is a cable job. That is the part everyone plans: kill the power, unplug twenty-four RJ45s, slide the replacement in, plug them back, done inside an hour. None of that decides whether the site comes back. What decides it is how much the new box knows about the twenty-four things you just plugged into it, and almost none of that knowledge is written on the cable.

Two weeks ago I stood in a telecom room in Longgang with a 24-port PoE switch that had lost ports 5 through 8 to a nearby strike. The replacement was the same model family, the config came back from a text export, and twenty cameras were supposed to reappear. Eighteen did, inside three minutes. One came back at 720p with no recording schedule. One never came back, and nobody noticed until a guard saw a black tile at 07:40 the next morning. The swap took forty minutes. The cleanup took two days, and not one minute of it was hardware.

The config file has no idea where the cables go

An exported config is a list of intentions indexed by port number. Port 12 means "the twelfth hole in this particular metal box." Swap the box and every number in the file is redefined, even when the replacement has the same port count and vendor badge.

I have been bitten by the boring version. Old unit: 24 copper ports with four combo cages sharing 21–24. Replacement: 24 copper plus two dedicated SFP+ cages. Restore one-to-one and the CLI looks right — except the old file had a trunk on port 22 because a camera lived on that shared copper, and the new file applies the trunk to an empty cage. The camera came up on a copper port carrying someone else's access VLAN. Link light on, video black, counters healthy.

The larger problem is that neither the label nor the config describes the present. The label records what an installer intended three years ago; the config records what someone typed, possibly from a template. In between, a camera moved, an AP was replaced, a cleaner unplugged something and put it back in the nearest free hole. I once chased a "dead port" for an hour before noticing that the label reading AP-2F-STAIRS sat on a port that had been a camera since the AP moved in 2024. Restoring that config faithfully would have dropped a camera into an AP's VLAN, under its QoS policy and sticky-MAC port security. The port would have shut on the first frame, and I would have spent another hour blaming the camera.

So the first rule I follow now: capture reality before anything else. LLDP neighbours, the MAC table, and the PoE status page are reality. The running config is a claim.

Why every camera reboots even when the swap is perfect

A PSE has no memory of the device that was there before. On power-up it treats every port as empty and runs the handshake again: detection between 2.7 and 10.1 V, a look for the 19–26.5 kΩ signature (about 108 µA at 2.7 V through 25 kΩ), classification at 12.5 V, then power. That takes well under a second per port. Cumulatively it means every camera lost power, and a camera that lost power has to boot.

This is where the marketing gets ahead of the physics. Perpetual PoE, Fast PoE, call-it-what-you-like power retention does exist and is genuinely useful — during a soft reload, the PSE keeps ports energised while the CPU restarts, so the PDs never notice. Read the fine print: per port, off by default, and the switch has to learn the device's draw first. None of that survives pulling the cable out of the jack. A swap is a physical disconnect on every port.

The practical consequence: your shortest possible outage is one camera boot, not one rack procedure. If the PTZ needs forty seconds to pan through its self-test, forty seconds is the floor. Everything else in the plan is about not making it longer.

Then there are the defaults nobody reads. Many PoE switches ship with a 15.4 W port limit, PoE priority at low, and a budget figure that matches the power supply rather than the label on the front. Put a class 4 PTZ that pulls 22 W with the heater on into a 15.4 W port and you get link, no power, and a row reading "denied" in a table nobody opens until morning. The old unit had that port raised to 30 W in 2023. The new one has no idea, because port caps are the first thing a partial restore loses.

Seven things to write down before you unplug anything

This is the list on the sticky note in my laptop bag. Twenty minutes on a 24-port switch, and the same discipline I use at handover — the six measurements to record at handover are exactly what you want in hand before pulling a cable.

  1. The running config as text, plus the exact firmware string. A binary backup restores into an identical model on an identical firmware. Anything else and you are pasting text and hoping the parser agrees.
  2. An LLDP neighbour dump, port by port. What is actually downstream, including the devices whose labels are wrong. If the cameras have no LLDP, fall back to the MAC table.
  3. The MAC address table, matched against the NVR's channel list. Camera MAC to switch port to recorder channel is the only map that survives a real swap.
  4. The PoE status page: class, allocated watts, measured watts, priority, per-port limit. On most managed PoE switches this is one table, and allocated and measured are different columns. A camera allocated 30 W while drawing 6 W behaves very differently on a unit that allocates 15.4 W.
  5. The uplink truth. Native VLAN, allowed list, LACP mode and key, STP priority, and whether this box happens to be the root bridge.
  6. Management identity. IP, mask, gateway, management VLAN, NTP, syslog target, SNMP. Miss the syslog target and you lose the only evidence of what happens next.
  7. Which cameras are static and which are DHCP, and which sit behind 802.1X or sticky-MAC port security. Four settings that turn a clean swap into a two-day cleanup.
Layer Comes back by itself Needs a human after the swap
Copper and connectors Nothing Re-seating every jack, checking the ones you rushed for bent pins
PoE negotiation Detection and classification, within a second Per-port watt caps, PoE priority, budget reservation
VLANs and uplink Only what the text config contains Native VLAN, allowed list, LACP key, any line the parser rejected
Spanning tree Election runs, possibly with the wrong winner Root priority, edge ports, BPDU guard on camera ports
Access control Nothing, and it fails closed 802.1X port state, sticky MAC entries, RADIUS reachability
Recorder mapping Nothing Channel to IP binding, stream profile, recording schedule

The bench run that saves the site visit

Configure the replacement the day before, on a bench, not in the rack at 23:00. Paste the config in sections and read the parser output between them. Bulk paste is where silent rejections hide: a line the firmware does not recognise scrolls past, the prompt comes back, and you assume it took. On one unit last month, six lines about PoE port limits vanished without an error because that firmware used a different command path. Everything else applied, and the box looked perfectly configured.

Do not upgrade firmware during the swap. Do it on the bench, re-apply the config, then soak the unit for ten minutes with four powered devices — a fixed camera, a PTZ, an AP, and whatever else the site runs. Then pull a cable and watch the port re-detect. That one pull tells you more than any datasheet, because it is the exact event the site is about to experience twenty-four times.

Above roughly sixteen cameras I use the two-switch trick: rack the spare beside the old unit, give it one uplink and its own address, move six cameras onto it, verify those six on the wall, then move the rest. It costs an extra uplink port, a second IP, and some care with spanning tree so the temporary pair does not loop. What it buys is a rollback that takes ninety seconds instead of an argument about an RMA.

One note on spare parts: a PoE injector is a fine way to keep a single entrance camera alive through a swap, but check the class, not the wattage printed on the box. A 15.4 W midspan on a 22 W PTZ with the heater running browns out after dark, and you have traded one outage for a slower one.

Four minutes, and where they go

People budget for the rack work and forget the clock that starts after the last cable clicks. Here is the sequence on a managed 24-port unit, measured on my bench and confirmed twice on site.

Stage Typical time What you see
Power to first forwarding port 50–95 s Link lights appear before the data path exists; do not trust them
PoE controller starts detecting +8–20 s after boot Port LEDs change colour; PDs begin to draw current
Port stagger across 24 ports +3–8 s Some units bring ports up two at a time to limit inrush
Camera boot to first stream 25–45 s, PTZ up to 90 s A tile that is black but not "no signal" is usually still booting
Recorder re-registration 15–60 s NVRs retry on a fixed poll interval, so the last channel lands late

Add the middle column and you get roughly 68 + 15 + 4 + 40 + 45 ≈ 172 seconds: three minutes, on a swap where nothing else goes wrong. On a bad day it runs closer to six, because the recorder polled, missed, and will not try again until the next cycle.

Two things stretch that clock. First, spanning tree. If the dead switch was the root bridge — often true in small sites, because nobody has touched the priority from 32768 — the replacement arrives with the same default and the election can land somewhere unexpected. RSTP fixes it in a second or two; plain STP holds you thirty to fifty seconds, and it holds the whole VLAN, not just the cameras on the new box. Second, access control. Ports on 802.1X come back unauthorised and give the cameras nothing but link until RADIUS answers. Sticky-MAC port security is worse in a quiet way: the table lives in the config on some platforms and in volatile memory on others, so the same procedure behaves differently on two units from one vendor.

Two things I had wrong

I spent years telling people that labelling the cables was the answer. It is not, and the reason took me a while to see: a label records a decision, and decisions age. The MAC table records a fact. Now I photograph the faceplate with the cables in it, dump the MAC table, and treat labels as a hint rather than a description. The photo takes eight seconds and has settled more arguments than any config export.

The second thing I had backwards was timing. I used to schedule swaps at two in the morning, on the theory that fewer people would notice. That is exactly wrong. The failure mode is not a loud outage, it is one channel that never reconnects, and the only sensor for that is a human looking at a wall of video. A guard who spots a black tile at 02:10 calls someone at 07:00. A guard who spots it at 09:35 walks over and tells you while your laptop is still open. Weekday mornings, channel list printed, someone watching. I have not regretted the daylight once.

Questions I get asked after every swap

Can a PoE switch be swapped with zero camera downtime?

Not by unplugging it. Power retention keeps PDs alive through a soft reload, worth having on a box that reboots for firmware. A physical swap cuts every port, the PSE re-runs detection, and each camera boots on its own clock. The realistic target is "back inside four minutes," not "no gap."

Does the replacement have to be the same model?

No, but the further you move, the more the config becomes a suggestion. Same model and firmware is a text restore. Same vendor, different model, means checking that every PoE command survived the parser. Different vendor means rebuilding VLANs, watt caps and management settings by hand, and re-checking the port map, because port numbering is not portable.

Only some cameras failed. Why those?

Usually one of four things: the new port's watt cap is below the camera's allocation, the port sits in a VLAN the restore did not carry, the camera relies on DHCP or 802.1X and the defaults differ, or the cable took damage during the move. The first three all show a healthy link with no video, which is why they get blamed on the camera. I work outward from the port, same order as the 9-step camera power-up checklist.

Can I keep one critical camera alive with an injector during the swap?

Yes, and it is worth doing for a single entrance camera. Put a midspan injector inline, power it from another circuit, and move that cable last. Check the injector's class against the camera's real draw with the IR on, not the figure on the datasheet. You lose per-port statistics, so log the camera's address first.

Should I factory-reset the old switch before it goes back?

Yes, and take the config export off it first. A returned unit carries your VLANs, your management credentials, and often a syslog target whose hostname describes your site to a stranger. Reset it, then confirm the management address is gone — some platforms keep it until you clear the startup file too.

The swap is the easy part, which is what makes it dangerous: it finishes before the failures start. If your procedure beats mine — a port map format, a rollback trick, a way to make a recorder re-register faster than a sixty-second poll — I would like to hear it. The best idea in my own version came from a technician in Foshan who labels both cable ends with the recorder channel number. I have been stealing it ever since.