HiveMQ 4.27.x to 4.28.x Migration Guide
This is a minor HiveMQ upgrade. HiveMQ 4.28 is a drop in replacement for HiveMQ 4.27.x.
You can learn more about all the new features HiveMQ 4.28 introduces in our release blogpost.
HiveMQ is prepackaged with all HiveMQ Enterprise Extensions (disabled), HiveMQ Data Hub, the open-source MQTT CLI tool, and the HiveMQ Swarm load-testing tool (MQTT CLI and HiveMQ Swarm are located in the tools
folder of your HiveMQ installation).
HiveMQ 4.28 is an LTS (Long Term Support) release.
Starting with the HiveMQ 4.9 LTS release, HiveMQ provides enhanced version compatibility for all HiveMQ releases.
For more information, see HiveMQ Rolling Upgrade Policy and our Introducing Flexible MQTT Platform Upgrades with HiveMQ blog post.
To learn more about the differences between the 4.9 LTS and the new 4.28 LTS version, see Newly Released Features in HiveMQ Enterprise MQTT Platform 4.28 LTS.
When you migrate from one HiveMQ version to another, we recommend that you review the upgrade information for each version between your current HiveMQ version and the target HiveMQ version. Note changes that are relevant to your use case and adjust your configuration as needed. If you plan to migrate from the previous LTS (4.9) version to the new LTS version (4.28), see our 4.9 to 4.28 Migration Guide. |
Upgrade a HiveMQ Cluster
Rolling upgrades are supported, and it is possible to run HiveMQ version 4.27 and version 4.28 simultaneously in the same cluster. By default, the HiveMQ cluster enables all new cluster features when all nodes are upgraded to the new version. No manual intervention is required.
Please follow the instructions in our user guide to ensure a seamless and successful rolling upgrade.
Upgrade a Single-node HiveMQ Instance
-
Create a backup of the entire HiveMQ 4.27.x installation folder from which you want to migrate.
-
Install HiveMQ 4.28 as described in the HiveMQ Installation Guide.
-
Migrate the contents of the configuration file from your old HiveMQ 4.27.x installation.
-
To migrate your persistent data, copy everything from the
data
folder of your backup to the data folder of the new HiveMQ 4.28 installation.
HiveMQ Configuration File Changes
HiveMQ prevents the startup if your configuration file contains invalid values. For more information, see Configuration Validation. |
HiveMQ Persistent Data Migration
When you migrate, HiveMQ 4.28 automatically updates the file storage formats of all the data that you copied into your new data folder.
To migrate the persistent data, you must copy everything in the data folder of the previous HiveMQ 4.27.x installation to the data folder of your new HiveMQ 4.28 installation.
cp -r /opt/hivemq-4.27.0/data/* /opt/hivemq-4.28.0/data/
The first time you start HiveMQ 4.28, the file storage formats of the persistent data from your previous installation are automatically updated in the new persistent storage.
HiveMQ Container Image Enhancements
HiveMQ 4.28 introduces several best-practice enhancements for the official HiveMQ 4.28 container images.
Improved Linux User Handling in the Container Images
The Linux user handling in the hivemq/hivemq4:4.28.0
, hivemq/hivemq4:dns-4.28.0
, and hivemq/hivemq4:k8s-4.28.0
container images has been improved in the following ways:
-
The Linux user
hivemq
is no longer available; utilize the numerical user ID10000
instead. -
The Linux group
hivemq
is no longer available. -
Containers now run as a non-root user with the numerical ID
10000
by default. Previously, containers started as root by default, and stepped down from the root privilege. -
When you use a
FROM hivemq/hivemq4:…
command in your Dockerfile to build custom images from the official HiveMQ images, all your commands run with the user10000
. To override the default behavior, you can add aUSER 0
command before, and aUSER 10000
command after your own commands. -
If you execute a command in a HiveMQ container (for example,
docker exec
), the command is executed by user10000
. If you require root permissions, you must explicitly specify the user (for example,docker exec -u 0
).
Improved File Permissions in the Container Images
In the hivemq/hivemq4:4.28.0
, hivemq/hivemq4:dns-4.28.0
, and hivemq/hivemq4:k8s-4.28.0
container images, unnecessary file write and execute permissions have been removed.
Instead of 770
permissions for all files and directories under /opt/hivemq
, …
-
Directories now have
750
permissions, except …-
Directories in which files may be created have
770
permissions, for example/opt/hivemq/extensions
.
-
-
Files now have
640
permissions, except …-
Files that might be executed have
750
permissions, for example/opt/hivemq/bin/run.sh
. -
Files that might be written to have
660
permissions, for example/opt/hivemq/conf/config.xml
.
-
These changes do not affect operation of HiveMQ when using the official HiveMQ container images.
The changes might affect you if you build custom images based on the official HiveMQ images, and you require more permissions on some files inside your Dockerfile
.
To get access to more file permissions, temporarily change to user 0
with a USER 0
command before, and a USER 10000
command after your own commands.
Availability of unzip
in the Container Images
The hivemq/hivemq4:4.28.0
and hivemq/hivemq4:dns-4.28.0
container images no longer have the unzip
tool installed.
The unzip tool is still installed in the hivemq/hivemq4:k8s-4.28.0 container image.
|
When you use a FROM hivemq/hivemq4:…
command in your Dockerfile to build custom images from the official HiveMQ images, you cannot use unzip
in your RUN
commands.
We recommend that you use an additional build stage for any unzip operation and copy over the unzipped files into the final image.
For more information, see Multi-stage Docker builds.
It is also possible to install the package before your RUN
commands.