VerneMQ is a clustered, Erlang-based MQTT broker that many teams picked for its horizontal scaling. Running it well means caring about cluster membership, netsplits, LevelDB message stores, Erlang cookies and a plugin system where authentication and business logic often live in Lua scripts or webhooks. When a team decides it would rather not operate that cluster any more, a VerneMQ migration has two parts: the mechanical part (listeners, users, ACLs) and the archaeology part (what do those plugins actually do?).
vernemq-migration-skills is an open-source pair of AI agent skills that handles both. Installed in Claude Code, or loaded by any agent that understands SKILL.md skills, it audits your VerneMQ setup, writes a migration plan for ConnectMQ, configures a bridge from the cluster, and moves clients in waves you can roll back. This article walks through what it does and why each step exists.
What Is in the VerneMQ Migration Skills Repository?
The repository ships two skills that hand over to each other:
| Skill | Responsibility |
|---|---|
vernemq-migration-planner |
Config and plugin audit, workload sizing, ACL and mountpoint conversion, client ID map, written plan |
vernemq-migration-executor |
ConnectMQ smoke test, vmq_bridge or relay, retained copy, stream comparison, waves, cutover, troubleshooting |
Each skill carries reference documents the agent reads before it acts: a VerneMQ-to-ConnectMQ mapping, a bridge guide, a cutover and rollback runbook, and a target reference with ConnectMQ's endpoints, credential model, access control rules, plan limits and reason codes. Python scripts do the parts that should not be left to judgment: parsing configs, mapping IDs, checking message flow.
Auditing vernemq.conf and the Plugins
The planner starts by collecting vernemq.conf from the nodes (or the DOCKER_VERNEMQ_* variables and Helm values on Kubernetes), plus vmq.acl and vmq.passwd. Then it runs:
python scripts/vernemq_audit.py --conf /etc/vernemq/vernemq.conf --out migration/
Every key = value line is classified as a blocker, an action, a plan check or plain information, with the ConnectMQ equivalent next to it. Cluster internals such as nodename, distributed_cookie, leveldb.* and the netsplit switches are marked as not applicable, because a managed broker does not expose them. The findings that shape a plan usually look like this:
plugins.vmq_webhooks = onorplugins.vmq_diversity = on: blocker. Auth and event hooks do not run on ConnectMQ. The skill asks what each hook decides, then plans a replacement: credentials and ACL rules for auth hooks, and a subscriber service for side effects like database writes.listener.ssl.require_certificate = on: blocker. Devices that log in with certificates need username and password over TLS instead.persistent_client_expiration(VerneMQ keeps sessions forever by default) andmax_offline_messages: checked against the plan's maximum session expiry.max_message_size = 0: unlimited on VerneMQ, so the largest real payload has to be measured.listener.*.mountpoint: an action, explained below.- Existing
vmq_bridge.*settings: listed so they can be re-created or retired.
Sizing the Workload with vmq-admin
Numbers decide the plan, so the planner samples the cluster with VerneMQ's own tooling:
vmq-admin session show --client_id --user --is_online --peer_host --mountpoint
vmq-admin metrics show | grep -Ei 'socket_open|mqtt_publish_received|bytes_received|retain'
vmq-admin cluster show
The session export gives the client IDs and usernames to migrate and the peak online count. Metrics give message and byte rates; if Prometheus already scrapes /metrics, the skill takes the peaks from there. Connections and connected minutes are checked separately against the plans, because an always-on fleet can fit the connection limit and still need far more session minutes than the plan includes.
Mountpoints, ACLs and Client IDs
Mapping mountpoints to topic prefixes
VerneMQ mountpoints give each listener its own topic space: two devices on different mountpoints can both publish devices/x and never see each other. A ConnectMQ broker has one topic tree. Merging mountpoints without care would mix data that used to be isolated, so the planner records a decision per mountpoint: either a topic prefix such as factory/..., applied by the bridge's remote prefix, or a separate ConnectMQ broker.
Converting vmq.acl
vmq.acl uses the familiar Mosquitto-style syntax: user, topic [read|write] and pattern lines with %c, %u and %m. The audit converts it into ConnectMQ's ordered rule list:
readbecomes asubscriberule,writebecomespublish, no keyword means both.%cand%ubecome${clientid}and${username}, or expand into one rule per device or user when you pass the client and user maps. That way topics can keep the old device IDs even though ConnectMQ client IDs gain a prefix.%mexpands for the default mountpoint and each named mountpoint, so prefixed topics are covered.- Rules for anonymous clients and
$SYSare skipped and explained in the notes.
The output, migration/acl-rules.md, is a numbered table to enter in the ConnectMQ console. For rule design background, see MQTT ACL.
New credentials and client IDs
ConnectMQ generates credentials in its console, each with an issued client ID; devices connect with that ID or <ISSUED_ID>_<suffix>. The client_id_map.py script turns the session export into a map (sensor-0042 becomes c7f3k2_sensor-0042) and flags IDs with unsafe characters or case-only differences. If your devices were tuned to VerneMQ's max_client_id_size, the skill reminds you that the new IDs are longer.
Executing the Migration
The executor follows migration/plan.md, asks before each production change and records every step in migration/log.md.
Smoke test the target. verify_connectmq.py checks TLS login, QoS 0, 1 and 2, retained messages, Last Will, persistent sessions and the ACL denies you expect.
Bridge from one node. The vmq_bridge plugin connects the cluster to ConnectMQ over TLS, with the issued client ID, try_private = off, a persistent session and separate out and in topic lines. One node is enough because the cluster routes messages internally. Configuring the bridge on every node would create several connections with the same client ID, and they would keep taking over each other's session. On Kubernetes, where Helm values apply to every pod, the skill prefers the bundled relay.py, which runs as a single-replica Deployment.
Copy and compare. copy_retained.py moves retained state that existed before the bridge, and compare_streams.py subscribes on both brokers to prove that topics, message counts and payloads match.
Waves. Consumers move first, followed by a canary group and then growing device waves, each behind a go/no-go checklist. Before a wave, the executor confirms that any webhook side effect for those devices now runs in its replacement. That catches the classic failure where data silently stops reaching a database after cutover. Rolling back means restoring the previous client config, because the bridge keeps both brokers in sync.
Decommission. After the last wave soaks, the executor disables the bridge, watches the session list for stragglers and keeps the cluster around for the agreed rollback window.
Installing and Using the Skills
/plugin marketplace add connectmq/vernemq-migration-skills
/plugin install vernemq-migration-skills@connectmq-vernemq-migration
You can also copy skills/* into ~/.claude/skills/, or zip a skill folder and upload it to Claude.ai. The audit script uses only the Python standard library; the MQTT scripts need paho-mqtt 2.x. Then ask in plain words, for example: "Audit our VerneMQ cluster and plan a move to ConnectMQ" or "Configure vmq_bridge for telemetry and commands".
Is a VerneMQ Migration Right for You?
The skills suit teams whose VerneMQ cluster works but costs more attention than it is worth, and who want a managed MQTT broker with dashboards, access control and alerts while keeping standard MQTT clients. If you are still comparing options, start with self-hosted vs managed MQTT broker and the open-source MQTT broker comparison.
The same approach is available for other brokers: Mosquitto, HiveMQ, EMQX, AWS IoT Core and Azure IoT Hub.
Frequently Asked Questions
What happens to our vmq_diversity Lua scripts and webhooks?
They do not run on ConnectMQ. The planner lists every enabled hook and asks what it decides. Authentication hooks become ConnectMQ credentials and ACL rules. Side effects such as writing messages to a database move to a small service that subscribes to the relevant topics, using a shared subscription on Basic or Scale for load balancing.
Do we need to configure the bridge on every VerneMQ node?
No, and you should not. A VerneMQ cluster routes messages between nodes, so a bridge on one node sees all the traffic. Bridges on several nodes would share one client ID and keep disconnecting each other. On Kubernetes, the external relay is often simpler than per-pod bridge settings.
How are VerneMQ mountpoints handled?
ConnectMQ has one topic tree per broker. For each mountpoint, the plan chooses a topic prefix applied during bridging (for example factory/) or a separate ConnectMQ broker. The ACL converter expands %m so the prefixed topics are covered.
Can devices keep their VerneMQ usernames and client IDs?
Not unchanged. ConnectMQ issues new credentials, and client IDs must start with the credential's issued ID. The skills generate the client ID map and a user map, and they roll out host, credentials and client ID as a single config change per device.
Is the repository free to use?
Yes. Skills and scripts are MIT licensed on GitHub. Contributions with VerneMQ settings the audit does not recognise yet are welcome.



