Published July 21, 2026
RabbitMQ schema migration copies the broker definitions that make message routing work: virtual hosts, queues, exchanges, bindings, policies, users, permissions, and runtime parameters. RabbitMQ calls this metadata definitions. You normally migrate it before applications or queued messages are moved to a new cluster.
You can migrate schema with a definitions JSON file, application startup declarations, CLI or HTTP API automation, Kubernetes resources, or a visual compare-and-apply workflow in QueueExplorer. The right method depends on whether this is a one-time move or an on-going deployment process.
Schema is a useful shorthand for the logical broker configuration stored in RabbitMQ's internal metadata store. It describes where applications connect, how published messages are routed, and which users can access those resources.
| Usually part of definitions | Not part of definitions |
|---|---|
| Virtual hosts, queues, exchanges, and bindings | Messages currently stored in queues or streams |
| Users, password hashes, tags, permissions, and topic permissions | RabbitMQ and operating-system configuration files |
| Policies, operator policies, global parameters, and runtime parameters | Plugins, plugin binaries, TLS keys and certificates, or the Erlang cookie |
| Plugin-backed definitions such as dynamic Shovels when the plugin is available | Logs, alarms, metric history, connections, channels, or consumers |
A schema export should therefore be one part of a larger backup or migration strategy, not the entire strategy. The exported file can also contain password hashes, so store and transfer it as sensitive data.
You do not normally migrate definitions when adding or replacing a node in the same cluster. RabbitMQ replicates definitions to every cluster node. Schema migration is primarily a cluster-to-cluster, vhost-to-vhost, or environment-to-environment operation.
| Method | Best for | Main consideration |
|---|---|---|
| Definitions export and import | Complete one-time cluster or vhost migration | JSON must be reviewed for compatibility and secrets |
| QueueExplorer compare and import | Visual, selective migration and environment comparison | Requires an operator to review and apply the changes |
| Application declarations | Topology owned by a particular application | Shared policies, users, and platform objects need another owner |
| CLI or HTTP API scripts | Repeatable migrations with custom validation and transformations | The script must handle dependencies, failures, and version differences |
| Kubernetes Messaging Topology Operator | Continuously reconciled topology on Kubernetes | Declarative ownership and deletion behavior must be understood |
| Manual recreation | A few temporary objects | Slow, hard to audit, and prone to omitted arguments or bindings |
RabbitMQ can export definitions for an entire cluster or an individual virtual host. The core CLI works without the management plugin:
rabbitmqctl export_definitions /secure/path/rabbitmq-definitions.json
# Copy and review the file on the target system, then import it
rabbitmqctl import_definitions /secure/path/rabbitmq-definitions.json
rabbitmqadmin v2 provides equivalent commands through the management HTTP API:
rabbitmqadmin definitions export /secure/path/rabbitmq-definitions.json
rabbitmqadmin definitions import /secure/path/rabbitmq-definitions.json
You can also export and import through the Management UI or the /api/definitions HTTP endpoint.
Modern RabbitMQ versions can load definitions from a local file or HTTPS URL at node boot, which is useful for
preconfigured deployments. For large definition sets in a multi-node cluster, RabbitMQ recommends importing
after cluster formation to avoid every booting node repeating the work.
rabbitmqadmin v2 can transform exports, for example by excluding users and permissions,
obfuscating credentials, or removing obsolete classic-mirroring policy keys during an upgrade. Use the
current RabbitMQ schema definition guide because
available transformations and compatibility rules depend on the source and target versions.
QueueExplorer Professional provides a visual workflow for copying all or part of a RabbitMQ schema. It is useful when you want to see the target differences before changing anything, select individual objects, or copy topology between virtual hosts and servers.
QueueExplorer does not delete target objects during schema import. It can modify existing objects only where RabbitMQ permits the relevant property to change. This makes the preview safer, but it also means that an import is not an automatic cleanup of everything absent from the source.
Free trial for Windows, macOS, and Linux
Many RabbitMQ clients can declare exchanges, queues, and bindings when an application starts. Declaration is idempotent only when an existing object's durable, type, and argument values are compatible. A mismatch can close the channel with a precondition failure instead of changing an immutable queue or exchange.
Application declarations work well when one service clearly owns its topology. Platform-owned policies, shared exchanges, users, permissions, and cross-application bindings should still be deployed centrally. Document ownership so two systems do not continually fight over the same definition.
For repeated environment creation, store reviewed definitions or individual topology resources in version control and apply them through the deployment pipeline. On Kubernetes, RabbitMQ's Messaging Topology Operator can manage queues, exchanges, bindings, policies, users, permissions, virtual hosts, Federation, and Shovel resources.
Declarative ownership changes deletion semantics: removing a resource from the desired state may remove the corresponding RabbitMQ object and its data. Review retention or deletion policies, immutable fields, secret handling, namespace scope, and the Operator version before adopting this approach.
A correctly recreated queue is still empty. For a small, selected set of messages, QueueExplorer can copy or move messages to another RabbitMQ queue. Verify the destination before deleting the source copies.
For a live cluster migration, use an application drain or choose between Federation and Shovel as part of a controlled blue-green cutover. RabbitMQ's blue-green migration guide starts by importing definitions into the target, then uses inter-cluster transfer while consumers and producers are switched. If strict ordering matters, stop producers and let the chosen transfer mechanism drain completely before the final cutover.
Yes. rabbitmqctl export_definitions and import_definitions work without the management
plugin. rabbitmqadmin and the HTTP API require it. Application declarations, QueueExplorer, and
declarative operators provide other workflows.
Do not treat an import as a full replacement or synchronization operation. RabbitMQ boot-time imports do not overwrite definitions already present, and objects absent from the file are not a request to delete target objects. Existing incompatible declarations can fail. Compare the target and plan modifications or removals explicitly.
Yes. RabbitMQ can export definitions for one virtual host, and QueueExplorer can select a vhost or individual objects. A vhost-scoped export intentionally excludes unrelated vhosts and users without permissions for that vhost, so review what must be supplied separately.
No. It is a backup of logical definitions, not queue contents or node configuration. Preserve messages, configuration, certificates, secrets, and recovery documentation separately.
For related planning, read our guides to RabbitMQ policies, RabbitMQ exchanges, and RabbitMQ management tools.
See what is happening in RabbitMQ and resolve message problems without writing one-off tools. Browse queues and streams, inspect message contents, and manage your RabbitMQ environment from one desktop application. Try it free on Windows, macOS, or Linux.