Skip to main content
Community Scripts logo
Tools & Add-onsCopy Data

Copy data between containers

Scripts that copy an application's data directory from one LXC container to another on the same Proxmox VE node.

The scripts in tools/copy-data/ move application data from one LXC container to another. Use them when you rebuild an application in a fresh container, or switch between two ways of running the same application, and want to keep its configuration. None of them is listed on the website.

Which script copies what

ScriptFrom (path in the source container)To (path in the target container)Target emptied first
home-assistant-container-copy-data-home-assistant-containerHome Assistant Container: /var/lib/docker/volumes/hass_config/Home Assistant Container: /var/lib/docker/volumes/hass_config/Yes
home-assistant-container-copy-data-home-assistant-coreHome Assistant Container: /var/lib/docker/volumes/hass_config/_dataHome Assistant Core: /root/.homeassistantNo
home-assistant-container-copy-data-podman-home-assistantHome Assistant Container: /var/lib/docker/volumes/hass_config/Podman Home Assistant: /var/lib/containers/storage/volumes/hass_config/Yes
podman-home-assistant-copy-data-home-assistant-containerPodman Home Assistant: /var/lib/containers/storage/volumes/hass_config/Home Assistant Container: /var/lib/docker/volumes/hass_config/Yes
home-assistant-core-copy-data-home-assistant-containerHome Assistant Core: /root/.homeassistantHome Assistant Container: /var/lib/docker/volumes/hass_config/_dataNo
home-assistant-core-copy-data-home-assistant-coreHome Assistant Core: /root/.homeassistantHome Assistant Core: /root/No
plex-copy-data-plexPlex Media Server: /var/lib/plexmediaserver/Library/Plex Media Server: /var/lib/plexmediaserver/Library/No
z2m-copy-data-z2mZigbee2MQTT: /opt/zigbee2mqtt/data/Zigbee2MQTT: /opt/zigbee2mqtt/data/No
zwavejs2mqtt-copy-data-zwavejsuiZwavejs2MQTT: /opt/zwavejs2mqtt/store/Z-Wave JS UI: /opt/zwave-js-ui/store/No

How they work

All nine scripts follow the same pattern and run in the Proxmox VE host shell as root, not inside a container:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/copy-data/<name>.sh)"
  1. A text prompt asks whether to proceed.
  2. Two radio lists ask for the source container and the target container. Both list every container on the node.
  3. A confirmation dialog shows <source id> (<hostname>) -> <target id> (<hostname>). It is preselected on No.
  4. The target container is stopped if it is running. Only the Home Assistant Core to Core script also stops the source.
  5. Both root disks are mounted on the host with pct mount, and the script checks that the expected path exists in each.
  6. Three scripts delete and recreate the target directory (see the table). The others copy into the existing directory.
  7. rsync copies the data with --archive --hard-links --sparse --xattrs --no-inc-recursive --info=progress2.
  8. Both containers are unmounted again, also when the script fails.

Before you start

  • Create the target container first with its regular script, so the application and its data path exist.
  • Take a backup or snapshot of the target. The copy cannot be undone, and three scripts empty the target directory before copying.
  • Both containers must be on the node you run the script on, and rsync must be installed on the host.
  • Start the target container yourself afterwards; the scripts leave it stopped.

Each page lists the exact paths, the prompts and the known problems of that script. Read the limits section: on current main two scripts pass the rsync options in a form rsync does not accept, and two others place the files one directory level deeper than the target application expects.