zwavejs2mqtt-copy-data-zwavejsui
Copy the store directory of a Zwavejs2MQTT LXC into the store directory of a Z-Wave JS UI LXC.
zwavejs2mqtt-copy-data-zwavejsui.sh copies data between two LXC containers on the same node: Zwavejs2MQTT to Z-Wave JS UI. It is not listed on the website.
Source: tools/copy-data/zwavejs2mqtt-copy-data-zwavejsui.sh.
Run
In the Proxmox VE host shell, as root. If pveversion is missing the script prints "Run from the Proxmox Shell" and exits.
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/copy-data/zwavejs2mqtt-copy-data-zwavejsui.sh)"What is copied
| Container | Path inside the container | |
|---|---|---|
| From | the one you pick first | /opt/zwavejs2mqtt/store/ |
| To | the one you pick second | /opt/zwave-js-ui/store/ |
The content of the source directory is merged into the target directory. Existing files in the target are kept; files with the same path are overwritten.
Prompts
| Prompt | Choices | Effect |
|---|---|---|
Use to copy all data from a Zwavejs2MQTT LXC to a Z-wave JS UI LXC. Proceed(y/n)? | y / n | n exits. |
| "Which Zwavejs2MQTT LXC would you like to copy FROM?" (radio list of all containers) | One container | The source. The list is shown again until one is selected. |
| "Which Z-wave JS UI LXC would you like to copy TO?" (radio list of all containers) | One container | The target. |
| "Are you sure you want to copy data between the following LXCs?" | Yes / No, preselected No | No aborts the script with an [ERROR] line; nothing has been changed at that point. |
Both lists show every container of the node. The script does not check that the container you pick runs the expected application; it only checks that the paths exist.
Steps
- Stops the target container if running (
pct stop). - Mounts the root disks of both containers on the host with
pct mount. - Checks that the source path and the target path exist. If one is missing the script stops with "directories in '...' not found".
- The target directory is not emptied (the
rm -rflines in the script are commented out or absent). - Copies with
rsyncand the options--archive --hard-links --sparse --xattrs --no-inc-recursive --info=progress2. - On exit, also after an error, unmounts both containers with
pct unmountand removes its temporary directory.
After the copy
The script does not start any container. Start the target yourself and check the application:
pct start <target id>Limits
- There is no undo and no backup of the target. Back up or snapshot the target container first.
- The source and the target must be on the same node, and the application must already be installed in the target so that the target path exists.
rsyncmust be installed on the host; the script does not install it.- The script reads no environment variables and sends no telemetry.
- On current
mainthis script passes all rsync options as one quoted word (rsync "${RSYNC_OPTIONS[*]}" ...), so rsync receives a single argument--archive --hard-links --sparse --xattrs --no-inc-recursive --info=progress2instead of six options and does not accept it. The target directory is not emptied beforehand, so a failed copy leaves the target as it was. Read the source and test with containers you can afford to lose before relying on it. - The dialog title reads "Zigbee2MQTT to Z-wave JS UI Data Copy"; the script copies Z-Wave data.