Skip to content

Move a device between environments

Each environment (dev, staging, production) is a separate control plane with its own Nexus, Realtime worker, database and portal. A device's identity belongs to the environment that minted it, so moving a device means enrolling it again against the target environment, with a bootstrap token minted in that environment's portal.

Environment URLs

Environment Nexus (--addr) Realtime (--realtime)
dev https://dev.nexus.digilan-edge.com wss://dev.realtime.digilan-edge.com
staging https://stg.nexus.digilan-edge.com wss://stg.realtime.digilan-edge.com
production https://prod.nexus.digilan-edge.com wss://realtime.digilan-edge.com

Production Realtime has no prefix

The production Realtime URL is wss://realtime.digilan-edge.com, with no prod. prefix, unlike its Nexus URL.

Portal action

Requires a platform administrator, and the device must be online.

  1. In the target environment's portal, mint a bootstrap token at Admin → Enrollment (Enrollment).
  2. In the source environment's portal, open the device page and choose Move to environment.
  3. Pick the target (the URLs are filled in) and paste the token.

Nexus pushes a reenroll command to the agent. The agent enrolls against the target first and writes the new identity only if that succeeds, then restarts itself onto the new environment. A bad token or URL leaves the device exactly where it was. The portal shows the command's result as a toast.

From a shell on the box

For a device that is offline from the portal, or when you are at the box, use edge-agent reenroll from the remote console or the local console:

edge-agent reenroll \
  --addr <target-nexus> \
  --realtime <target-realtime> \
  --token <token-minted-in-target>
rcctl restart edge_agent

reenroll backs up the current identity to identity.json.bak, enrolls against the target before overwriting anything, and asks for confirmation (--yes skips it). The old credentials stay valid in the old environment, so restoring identity.json.bak and restarting switches back.

After the move

  • The device lands in the target environment's holding zone. Assign it there; see Device lifecycle.
  • The device row in the source environment is left behind, not deleted. Delete it there if the device is not coming back.
  • The agent binary does not change. All environments share one release signing key, so the device keeps receiving over-the-air updates in the new environment.